From d5e33a9d819eafc7363dee250c36b9f143a92d05 Mon Sep 17 00:00:00 2001 From: Dharmesh Patel Date: Fri, 5 Jul 2024 14:58:22 +0530 Subject: [PATCH] Fix tests in trunk. --- tests/cypress/e2e/create-post.test.js | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/tests/cypress/e2e/create-post.test.js b/tests/cypress/e2e/create-post.test.js index 8360391..2fc608b 100644 --- a/tests/cypress/e2e/create-post.test.js +++ b/tests/cypress/e2e/create-post.test.js @@ -98,15 +98,26 @@ describe('Command: createPost', () => { ) { name = 'Summary'; } - cy.openDocumentSettingsPanel(name); - }); - cy.get('label') - .contains('Stick to the top of the blog') - .click() - .parent() - .find('input[type="checkbox"]') - .should('be.checked'); + // WP 6.6 handling. + if ($body.find('.editor-post-summary').length === 0) { + cy.openDocumentSettingsPanel(name); + + cy.get('label') + .contains('Stick to the top of the blog') + .click() + .parent() + .find('input[type="checkbox"]') + .should('be.checked'); + } else { + cy.get( + '.editor-post-sticky__toggle-control input[type="checkbox"]' + ).check(); + cy.get( + '.editor-post-sticky__toggle-control input[type="checkbox"]' + ).should('be.checked'); + } + }); }, });