Feature: As a admin, I should be able to add webhooks to account (#572)
Co-authored-by: Pranav Raj S <pranavrajs@gmail.com>
This commit is contained in:
committed by
GitHub
parent
e8cf59c661
commit
c119c6577b
@@ -0,0 +1,33 @@
|
||||
import * as types from '../../../mutation-types';
|
||||
import { mutations } from '../../webhooks';
|
||||
import webhooks from './fixtures';
|
||||
|
||||
describe('#mutations', () => {
|
||||
describe('#SET_WEBHOOK', () => {
|
||||
it('set webhook records', () => {
|
||||
const state = { records: [] };
|
||||
mutations[types.default.SET_WEBHOOK](state, webhooks);
|
||||
expect(state.records).toEqual(webhooks);
|
||||
});
|
||||
});
|
||||
|
||||
describe('#ADD_WEBHOOK', () => {
|
||||
it('push newly created webhook data to the store', () => {
|
||||
const state = {
|
||||
records: [],
|
||||
};
|
||||
mutations[types.default.ADD_WEBHOOK](state, webhooks[0]);
|
||||
expect(state.records).toEqual([webhooks[0]]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('#DELETE_WEBHOOK', () => {
|
||||
it('delete webhook record', () => {
|
||||
const state = {
|
||||
records: [webhooks[0]],
|
||||
};
|
||||
mutations[types.default.DELETE_WEBHOOK](state, webhooks[0].id);
|
||||
expect(state.records).toEqual([]);
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user