Skip to content

Commit

Permalink
new test for popup position logic Semantic-Org#1482
Browse files Browse the repository at this point in the history
  • Loading branch information
Petar Petrov committed Jul 26, 2017
1 parent c5d8f52 commit ba7c29c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/specs/modules/Popup/Popup-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,21 @@ describe('Popup', () => {
expect(bottom).to.be.at.most(document.documentElement.clientHeight)
expect(right).to.be.at.most(document.documentElement.clientWidth)
})
it('is the original if no position fits within the viewport', () => {
wrapperMount(
<Popup
content='_'
position={position}
trigger={<button>foo</button>}
on='click'
offset={999}
/>
)
wrapper.find('button').simulate('click')
const selectedPosition = wrapper.state('position')

expect(selectedPosition).to.equal(position)
})
})
})

Expand Down

0 comments on commit ba7c29c

Please sign in to comment.