Skip to content

Commit

Permalink
Update test with more details on resetState()
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Wahlin authored and Dan Wahlin committed Feb 29, 2020
1 parent ad850cb commit 07843fb
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions modules/observable-store/tests/observable-store.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,14 @@ describe('Observable Store', () => {
expect(mockStore.currentState.prop1).toEqual('test');
});

it('should change reset the store state', () => {
it('should reset the store state', () => {
let newState = { prop1: 'reset prop1 state', prop2: null, user: 'reset user state', users: null };
mockStore.updateProp1('test');
ObservableStore.resetState(null);
expect(mockStore.currentState).toBe(null);
ObservableStore.resetState(newState);
expect(mockStore.currentState.prop1).toEqual('reset prop1 state');
expect(mockStore.currentState.user).toEqual('reset user state');
expect(userStore.currentState.prop1).toEqual('reset prop1 state');
expect(userStore.currentState.user).toEqual('reset user state');
});

it('should execute an anonymous function', () => {
Expand Down

0 comments on commit 07843fb

Please sign in to comment.