mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
committed by
Géry Debongnie
parent
7e7226213a
commit
e005090296
@@ -95,6 +95,21 @@ describe("basic use", () => {
|
||||
expect(store.state.n).toBe(11);
|
||||
});
|
||||
|
||||
test("return data from committing a mutation", () => {
|
||||
const state = { n: 1 };
|
||||
const mutations = {
|
||||
inc({ state }) {
|
||||
return ++state.n;
|
||||
},
|
||||
};
|
||||
const store = new Store({ state, mutations });
|
||||
|
||||
expect(store.state.n).toBe(1);
|
||||
const res = store.commit("inc");
|
||||
expect(store.state.n).toBe(2);
|
||||
expect(res).toBe(2);
|
||||
});
|
||||
|
||||
test("dispatch allow synchronizing between actions", async () => {
|
||||
const state = { n: 1 };
|
||||
const mutations = {
|
||||
|
||||
Reference in New Issue
Block a user