import { ReactWrapper } from 'enzyme' ; import { waitForUI } from '@unilogin/react/testutils' ; export default class ConnectionFlow { constructor ( private wrapper ) { } clickConnectWithAnotherDevice ( ) { this . wrapper . find ( '#emoji' ) . simulate ( 'click' ) ; } clickCancel ( ) { this . wrapper . find ( '.cancel-emoji-btn' ) . simulate ( 'click' ) ; } async waitForEmojiView ( timeout ? ) { await waitForUI ( this . wrapper , ( ) => this . wrapper . html ( ) . includes ( 'emoji-panel-list' ) , timeout ) ; } async waitForConnectionChoiceView ( timeout ? ) { await waitForUI ( this . wrapper , ( ) => this . wrapper . text ( ) . includes ( 'Connect with another device' ) , timeout ) ; } }