feat: Campaign table (#2212)
* code cleanup * add campaign table * update locale texts * locale text cleanup * Rename selectedAgent with selectedSender in add campaign form * code cleanup * remove timer mixin * update avatar size to 20px * add border for table * add campaigns get action specs * rename campaign table component * fix style issues * update sender list based on inbox permission * style fixes * review fixes * add campaign sender component * replace wootsubmit button with wootbutton * update scroll width * replace campaign status with woot label * changes as per review * style fixes * remove unused code * disable campaign in inbox settings page * review fixes
This commit is contained in:
@@ -8,6 +8,25 @@ global.axios = axios;
|
||||
jest.mock('axios');
|
||||
|
||||
describe('#actions', () => {
|
||||
describe('#get', () => {
|
||||
it('sends correct actions if API is success', async () => {
|
||||
axios.get.mockResolvedValue({ data: campaignList });
|
||||
await actions.get({ commit });
|
||||
expect(commit.mock.calls).toEqual([
|
||||
[types.default.SET_CAMPAIGN_UI_FLAG, { isFetching: true }],
|
||||
[types.default.SET_CAMPAIGNS, campaignList],
|
||||
[types.default.SET_CAMPAIGN_UI_FLAG, { isFetching: false }],
|
||||
]);
|
||||
});
|
||||
it('sends correct actions if API is error', async () => {
|
||||
axios.get.mockRejectedValue({ message: 'Incorrect header' });
|
||||
await actions.get({ commit });
|
||||
expect(commit.mock.calls).toEqual([
|
||||
[types.default.SET_CAMPAIGN_UI_FLAG, { isFetching: true }],
|
||||
[types.default.SET_CAMPAIGN_UI_FLAG, { isFetching: false }],
|
||||
]);
|
||||
});
|
||||
});
|
||||
describe('#create', () => {
|
||||
it('sends correct actions if API is success', async () => {
|
||||
axios.post.mockResolvedValue({ data: campaignList[0] });
|
||||
|
||||
Reference in New Issue
Block a user