From 39390ab2f404ed2928581d208977db846756e19b Mon Sep 17 00:00:00 2001 From: Andrei Draganescu Date: Fri, 1 Dec 2023 20:48:06 +0200 Subject: [PATCH] stub e2e for pref modal --- .../specs/editor/various/pref-modal.spec.js | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 test/e2e/specs/editor/various/pref-modal.spec.js diff --git a/test/e2e/specs/editor/various/pref-modal.spec.js b/test/e2e/specs/editor/various/pref-modal.spec.js new file mode 100644 index 0000000000000..6f4c35d118a91 --- /dev/null +++ b/test/e2e/specs/editor/various/pref-modal.spec.js @@ -0,0 +1,40 @@ +/** + * WordPress dependencies + */ +const { test, expect } = require( '@wordpress/e2e-test-utils-playwright' ); + +test.describe( 'Preferences modal', () => { + test.beforeEach( async ( { admin } ) => { + await admin.createNewPost(); + } ); + + test.afterEach( async ( { admin } ) => { + await admin.trashPost(); + } ); + + test.describe( 'Preferences modal adaps to viewport', () => { + test( 'Enable pre-publish flow is visible on desktop ', async ( { + page, + } ) => { + const optionsButton = page + .getByRole( 'region', { name: 'Editor top bar' } ) + .getByRole( 'buton', { + name: 'Options', + } ); + + await optionsButton.click(); + + const preferencesButton = page.getByRole( 'menuitem', { + name: 'Preferences', + } ); + + await preferencesButton.click(); + + const prePublishToggle = page.getByRole( 'label', { + name: 'Enable pre-publish flow', + } ); + + await expect( prePublishToggle ).toBeVisible(); + } ); + } ); +} );