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:
Nithin David Thomas
2020-02-29 17:43:49 +05:30
committed by GitHub
parent e8cf59c661
commit c119c6577b
36 changed files with 845 additions and 49 deletions

View File

@@ -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([]);
});
});
});