From ba7c29c99c26ea07b8d830cb722a4a5600711b65 Mon Sep 17 00:00:00 2001 From: Petar Petrov Date: Wed, 26 Jul 2017 09:12:19 +0300 Subject: [PATCH] new test for popup position logic #1482 --- test/specs/modules/Popup/Popup-test.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/specs/modules/Popup/Popup-test.js b/test/specs/modules/Popup/Popup-test.js index 08eb220cc5..d793e48964 100644 --- a/test/specs/modules/Popup/Popup-test.js +++ b/test/specs/modules/Popup/Popup-test.js @@ -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( + foo} + on='click' + offset={999} + /> + ) + wrapper.find('button').simulate('click') + const selectedPosition = wrapper.state('position') + + expect(selectedPosition).to.equal(position) + }) }) })