Skip to content

Commit 0b4d150

Browse files
committed
test(unit): verify that mutation sets value on a state
1 parent 580c81f commit 0b4d150

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/unit/base-servuex.spec.js

+11
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,17 @@ describe('BaseServuex: ', () => {
8585
expect(store.commit).toHaveBeenCalledWith(`${namespace}/set_mockProp1`, newValue)
8686
})
8787

88+
it('updates right property on commit', () => {
89+
// eslint-disable-next-line no-unused-vars
90+
const childServuex = new MockServuex(namespace, store)
91+
92+
const newValue = 'new value'
93+
94+
schema.mutations.set_mockProp2(schema.state, newValue)
95+
96+
expect(schema.state.mockProp2).toBe(newValue)
97+
})
98+
8899
it('calls commit that exists on the schema', () => {
89100
const childServuex = new MockServuex(namespace, store)
90101

0 commit comments

Comments
 (0)