diff --git a/package.json b/package.json index 91b3898..23478d4 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,8 @@ "watch": "10up-toolkit watch", "build": "10up-toolkit build", "format-js": "10up-toolkit format-js", - "lint-js": "10up-toolkit lint-js", - "lint-js-fix": "10up-toolkit lint-js --fix", + "lint-js": "wp-scripts lint-js ./assets ./includes", + "lint-js-fix": "wp-scripts lint-js ./assets ./includes --fix", "lint-style": "10up-toolkit lint-style", "test": "10up-toolkit test-unit-jest", "wp-env": "wp-env", diff --git a/tests/cypress/integration/pmk-block-patterns.test.js b/tests/cypress/integration/pmk-block-patterns.test.js index 95c8bfe..28d1fea 100644 --- a/tests/cypress/integration/pmk-block-patterns.test.js +++ b/tests/cypress/integration/pmk-block-patterns.test.js @@ -1,23 +1,31 @@ -describe( 'Check if Media Kit Block Pattern is available for use', () => { - it( 'Can insert the block pattern', () => { - cy.visitAdminPage( 'post-new.php' ); - cy.closeWelcomeGuide(); - cy.get( '#post-title-0, h1.editor-post-title__input' ).click( { force: true } ).type( 'Test Block Pattern' ); - cy.get( '.edit-post-header-toolbar__inserter-toggle, .editor-document-tools__inserter-toggle' ).click(); - cy.get( '.components-tab-panel__tabs button, .block-editor-inserter__tabs button, .block-editor-tabbed-sidebar__tablist button' ).contains( 'Patterns' ).click(); +describe('Check if Media Kit Block Pattern is available for use', () => { + it('Can insert the block pattern', () => { + cy.visitAdminPage('post-new.php'); + cy.closeWelcomeGuide(); + cy.get('#post-title-0, h1.editor-post-title__input') + .click({ force: true }) + .type('Test Block Pattern'); + cy.get( + '.edit-post-header-toolbar__inserter-toggle, .editor-document-tools__inserter-toggle', + ).click(); + cy.get( + '.components-tab-panel__tabs button, .block-editor-inserter__tabs button, .block-editor-tabbed-sidebar__tablist button', + ) + .contains('Patterns') + .click(); - // (add version) If dropdown is available. (After WP 5.?). - cy.get( 'body' ).then( ( $body ) => { - if ( $body.find( '.components-select-control__input' ).length > 0 ) { - cy.get( '.components-select-control__input' ).select( 'publisher-media-kit', { - force: true, - } ); - } else if ( $body.find( '[aria-label="Publisher Media Kit"]' ).length > 0 ) { - cy.get( '[aria-label="Publisher Media Kit"]' ).click(); - } + // (add version) If dropdown is available. (After WP 5.?) + cy.get('body').then(($body) => { + if ($body.find('.components-select-control__input').length > 0) { + cy.get('.components-select-control__input').select('publisher-media-kit', { + force: true, + }); + } else if ($body.find('[aria-label="Publisher Media Kit"]').length > 0) { + cy.get('[aria-label="Publisher Media Kit"]').click(); + } - // Check if cover patter exist in the list. - cy.get( '[aria-label="Publisher Media Kit - Cover"]' ).should( 'exist' ); - }); - }); + // Check if cover patter exist in the list + cy.get('[aria-label="Publisher Media Kit - Cover"]').should('exist'); + }); + }); });