feat: Allow users to disable marking offline automatically (#6079)

Co-authored-by: Nithin David <1277421+nithindavid@users.noreply.github.com>
This commit is contained in:
Pranav Raj S
2022-12-16 11:59:27 -08:00
committed by GitHub
parent 82d3398932
commit aaacf9d4d2
14 changed files with 188 additions and 14 deletions

View File

@@ -88,6 +88,38 @@ describe('#actions', () => {
});
});
describe('#updateAutoOffline', () => {
it('sends correct actions if API is success', async () => {
axios.post.mockResolvedValue({
data: {
id: 1,
name: 'John',
accounts: [
{
account_id: 1,
auto_offline: false,
},
],
},
headers: { expiry: 581842904 },
});
await actions.updateAutoOffline(
{ commit, dispatch },
{ autoOffline: false, accountId: 1 }
);
expect(commit.mock.calls).toEqual([
[
types.default.SET_CURRENT_USER,
{
id: 1,
name: 'John',
accounts: [{ account_id: 1, auto_offline: false }],
},
],
]);
});
});
describe('#updateUISettings', () => {
it('sends correct actions if API is success', async () => {
axios.put.mockResolvedValue({