UNPKG

wix-style-react

Version:
30 lines (25 loc) 967 B
import eyes from 'eyes.it'; import { iconWithOptionsTestkitFactory } from '../../testkit/protractor'; import { waitForVisibilityOf } from 'wix-ui-test-utils/protractor'; import { getStoryUrl } from '../../test/utils/storybook-helpers'; describe('IconWithOptions', () => { const storyUrl = getStoryUrl('Deprecated', 'IconWithOptions'); const dataHook = 'story-iconWithOptions'; eyes.it( 'should hide dropdown when selecting an option which is not already selected', () => { browser.get(storyUrl); const driver = iconWithOptionsTestkitFactory({ dataHook }); waitForVisibilityOf(driver.element(), 'Cannot find iconWithOptions').then( () => { driver.mouseEnter(); driver.getDropdownItem(1).click(); driver.mouseLeave(); driver.mouseEnter(); driver.getDropdownItem(1).click(); expect(driver.getDropdown().isDisplayed()).toBe(true); }, ); }, ); });