Skip to content

Commit 54889c1

Browse files
committed
Update test
1 parent 15a0f04 commit 54889c1

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

lib/src/store/store.spec.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ type TestStoreState = {
1010
b: string;
1111
};
1212
};
13+
1314
class TestStore extends Store<TestStoreState> {
1415
constructor() {
1516
super('TestStore', {
@@ -50,7 +51,7 @@ describe('Store', () => {
5051
it('should subscribe to state changes', async () => {
5152
const stateValue = await firstValueFrom(store.select(state => state.a));
5253
expect(stateValue).toEqual({ a: 'a' });
53-
store.updateProperty('a', { a: 'A' });
54+
store.updateProperty('a', { a: 'A' }, 'a');
5455
const updatedStateValue = await firstValueFrom(
5556
store.select(state => state.a)
5657
);
@@ -59,11 +60,14 @@ describe('Store', () => {
5960

6061
it('should trigger state changes via custom actions', () => {
6162
const stateValue = store.snapshot.a;
62-
expect(stateValue).toEqual({ a: 'a' });
63-
store.update(state => ({
64-
...state,
65-
a: { a: 'A' },
66-
}));
63+
expect(stateValue).toEqual({ a: 'update a' });
64+
store.update(
65+
state => ({
66+
...state,
67+
a: { a: 'A' },
68+
}),
69+
'update a'
70+
);
6771
const updatedStateValue = store.snapshot.a;
6872
expect(updatedStateValue).toEqual({ a: 'A' });
6973
});
@@ -75,7 +79,7 @@ describe('Store', () => {
7579
store.select(state => state.a).subscribe(() => countStateChangesA++);
7680
store.select(state => state.b).subscribe(() => countStateChangesB++);
7781

78-
store.updateProperty('a', { a: 'A' });
82+
store.updateProperty('a', { a: 'A' }, 'update a');
7983

8084
expect(countStateChangesA).toEqual(2);
8185
expect(countStateChangesB).toEqual(1);

0 commit comments

Comments
 (0)