chore: Fix loading state in the inbox settings page (#4926)

This commit is contained in:
Pranav Raj S
2022-06-24 23:15:46 +05:30
committed by GitHub
parent 263b8240d3
commit c0249a1b5b
12 changed files with 106 additions and 97 deletions

View File

@@ -81,12 +81,9 @@ describe('#actions', () => {
{ id: updatedInbox.id, inbox: { enable_auto_assignment: false } }
);
expect(commit.mock.calls).toEqual([
[types.default.SET_INBOXES_UI_FLAG, { isUpdatingAutoAssignment: true }],
[types.default.SET_INBOXES_UI_FLAG, { isUpdating: true }],
[types.default.EDIT_INBOXES, updatedInbox],
[
types.default.SET_INBOXES_UI_FLAG,
{ isUpdatingAutoAssignment: false },
],
[types.default.SET_INBOXES_UI_FLAG, { isUpdating: false }],
]);
});
it('sends correct actions if API is error', async () => {
@@ -98,11 +95,8 @@ describe('#actions', () => {
)
).rejects.toThrow(Error);
expect(commit.mock.calls).toEqual([
[types.default.SET_INBOXES_UI_FLAG, { isUpdatingAutoAssignment: true }],
[
types.default.SET_INBOXES_UI_FLAG,
{ isUpdatingAutoAssignment: false },
],
[types.default.SET_INBOXES_UI_FLAG, { isUpdating: true }],
[types.default.SET_INBOXES_UI_FLAG, { isUpdating: false }],
]);
});
});

View File

@@ -53,7 +53,6 @@ describe('#getters', () => {
isFetchingItem: false,
isCreating: false,
isUpdating: false,
isUpdatingAutoAssignment: false,
isDeleting: false,
},
};
@@ -62,7 +61,6 @@ describe('#getters', () => {
isFetchingItem: false,
isCreating: false,
isUpdating: false,
isUpdatingAutoAssignment: false,
isDeleting: false,
});
});