feat: Add campaign (#2177)

This commit is contained in:
Muhsin Keloth
2021-05-04 15:08:41 +05:30
committed by GitHub
parent eaa61c3745
commit 7c7f91e70f
13 changed files with 792 additions and 19 deletions

View File

@@ -0,0 +1,21 @@
import types from '../../../mutation-types';
import { mutations } from '../../campaigns';
import campaigns from './fixtures';
describe('#mutations', () => {
describe('#SET_CAMPAIGNS', () => {
it('set campaigns records', () => {
const state = { records: [] };
mutations[types.SET_CAMPAIGNS](state, campaigns);
expect(state.records).toEqual(campaigns);
});
});
describe('#ADD_CAMPAIGN', () => {
it('push newly created campaigns to the store', () => {
const state = { records: [campaigns[0]] };
mutations[types.ADD_CAMPAIGN](state, campaigns[1]);
expect(state.records).toEqual([campaigns[0], campaigns[1]]);
});
});
});