-
Notifications
You must be signed in to change notification settings - Fork 753
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Corina
committed
Nov 5, 2018
1 parent
9b1c236
commit 86604b4
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
packages/app/client/src/ui/dialogs/postMigrationDialog/postMigrationDialog.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import * as React from 'react'; | ||
import { Provider } from 'react-redux'; | ||
import { createStore } from 'redux'; | ||
import { navBar } from '../../../data/reducer/navBar'; | ||
import { mount } from 'enzyme'; | ||
import { PostMigrationDialogContainer } from './postMigrationDialogContainer'; | ||
import { PostMigrationDialog, } from './postMigrationDialog'; | ||
import { CommandServiceImpl } from '../../../platform/commands/commandServiceImpl'; | ||
|
||
jest.mock('../../dialogs', () => ({})); | ||
|
||
describe('The PostMigrationDialogContainer component', () => { | ||
let wrapper; | ||
let node; | ||
|
||
beforeEach(() => { | ||
wrapper = mount( | ||
<Provider store={ createStore(navBar)} > | ||
<PostMigrationDialogContainer /> | ||
</Provider>); | ||
node = wrapper.find(PostMigrationDialog) | ||
}); | ||
|
||
it('should render deeply', () => { | ||
expect(wrapper.find(PostMigrationDialogContainer)).not.toBe(null); | ||
expect(node.find(PostMigrationDialog)).not.toBe(null); | ||
}); | ||
|
||
it('should contain a close function in the props', () => { | ||
expect(typeof (node.props() as any).close).toBe('function'); | ||
}); | ||
|
||
it('should call the appropriate command when a link is clicked', () => { | ||
const instance = node.instance(); | ||
const spy = jest.spyOn(CommandServiceImpl, 'remoteCall'); | ||
instance.onLearnMoreConfigAnchor(); | ||
expect(spy).toHaveBeenCalledWith('electron:open-external', 'https://aka.ms/about-bot-file'); | ||
instance.onLearnMoreNewFeaturesAnchor(); | ||
expect(spy).toHaveBeenCalledWith('electron:open-external', 'https://aka.ms/bot-framework-emulator-v4-overview'); | ||
}); | ||
}); |