Skip to content

Commit

Permalink
Unit test restitution
Browse files Browse the repository at this point in the history
  • Loading branch information
justinwilaby committed Jan 17, 2019
1 parent 668ce55 commit 4e075b1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/app/client/src/ui/helpers/activeBotHelper.spec.ts
Expand Up @@ -238,6 +238,18 @@ describe('ActiveBotHelper tests', () => {
}
});

it('should throw when confirmAndSwitchBots fails', async () => {
jest.spyOn(CommandServiceImpl, 'call').mockRejectedValueOnce('oh noes!');
jest.spyOn(botHelpers, 'getActiveBot').mockReturnValueOnce({path: ''});
try {
await ActiveBotHelper.confirmAndSwitchBots('');
expect(false);
} catch (e) {
expect(e).not.toBeNull();
}
jest.resetAllMocks();
});

it('confirmAndSwitchBots() functionality', async () => {
const backupBotAlreadyOpen = ActiveBotHelper.botAlreadyOpen;
const backupConfirmSwitchBot = ActiveBotHelper.confirmSwitchBot;
Expand Down

0 comments on commit 4e075b1

Please sign in to comment.