Skip to content

Commit

Permalink
Do not open sidebar if already opened in mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
mmtr committed Dec 23, 2019
1 parent bb209d5 commit aa9b155
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions test/e2e/lib/gutenberg/gutenberg-editor-sidebar-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,22 +168,15 @@ export default class GutenbergEditorSidebarComponent extends AsyncBaseContainer

async displayComponentIfNecessary() {
if ( driverManager.currentScreenSize() === 'mobile' ) {
const driver = this.driver;
const c = await driver.findElement( this.cogSelector ).getAttribute( 'class' );
if ( c.indexOf( 'is-toggled' ) < 0 ) {
return await driverHelper.clickWhenClickable( driver, this.cogSelector );
}
const gEditorComponent = await GutenbergEditorComponent.Expect( this.driver );
return await gEditorComponent.openSidebar();
}
}

async hideComponentIfNecessary() {
if ( driverManager.currentScreenSize() === 'mobile' ) {
const driver = this.driver;

const c = await driver.findElement( this.cogSelector ).getAttribute( 'class' );
if ( c.indexOf( 'is-toggled' ) > -1 ) {
return await driverHelper.clickWhenClickable( driver, this.closeSelector );
}
const gEditorComponent = await GutenbergEditorComponent.Expect( this.driver );
return await gEditorComponent.closeSidebar();
}
}

Expand Down

0 comments on commit aa9b155

Please sign in to comment.