Skip to content
This repository has been archived by the owner on Mar 30, 2018. It is now read-only.

Commit

Permalink
refactor the test
Browse files Browse the repository at this point in the history
  • Loading branch information
sureshHARDIYA committed Mar 21, 2017
1 parent 1e12a61 commit 04b9796
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/__tests__/Dropdown-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ it('changes the class when hovered', () => {
let tree = component.toJSON()
expect(tree).toMatchSnapshot()

// manually trigger the callback
// manually trigger the callback
tree.children[1].props.onMouseEnter()
expect(component.toJSON()).toMatchSnapshot()

// manually trigger the callback
// manually trigger the callback
tree.children[1].props.onMouseLeave()
expect(component.toJSON()).toMatchSnapshot()

// Fast forward timers, class should now be gone
// Fast forward timers, class should now be gone
jest.runAllTimers()
expect(component.toJSON()).toMatchSnapshot()

Expand All @@ -58,13 +58,13 @@ it('changes the class when hovered', () => {
expect(instance.state.isOpen).toBeTruthy()

component = renderer.create(
<Dropdown mode="hover">
<Dropdown delay={400} mode="hover">
<Button>Hover</Button>
<div className="uk-dropdown uk-dropdown-bottom-left">
{LoremIpsum}
</div>
</Dropdown>
)
)
instance = component.getInstance()
instance.handleMouseEnter()
expect(instance.state.isOpen).toBeTruthy()
Expand Down

0 comments on commit 04b9796

Please sign in to comment.