Skip to content

Commit

Permalink
chore: test without injection context
Browse files Browse the repository at this point in the history
Co-authored-by: Marko Stanimirović <[email protected]>
  • Loading branch information
brandonroberts and markostanimirovic authored May 8, 2023
1 parent dfdca6f commit 57c2639
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions modules/store/spec/integration_signals.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,16 +136,12 @@ describe('NgRx and Signals Integration spec', () => {
it('Store.selectSignal should not trigger on unrelated global state changes', () => {
let todosTriggerCount = 0;

const todos = TestBed.runInInjectionContext(() =>
store.selectSignal((state) => state.todos)
);

const todosTriggerState = TestBed.runInInjectionContext(() =>
computed(() => {
todos();
return ++todosTriggerCount;
})
);
const todos = store.selectSignal((state) => state.todos);

const todosTriggerState = computed(() => {
todos();
return ++todosTriggerCount;
});

store.dispatch({ type: ADD_TODO, payload: { text: 'first todo' } });
expect(todosTriggerState()).toBe(1);
Expand Down

0 comments on commit 57c2639

Please sign in to comment.