Skip to content

Commit

Permalink
a few more eslint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
faisal-alvi committed Dec 13, 2024
1 parent 1fbbdab commit b1ca754
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 22 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
48 changes: 28 additions & 20 deletions tests/cypress/integration/pmk-block-patterns.test.js
Original file line number Diff line number Diff line change
@@ -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', () => {

Check failure on line 1 in tests/cypress/integration/pmk-block-patterns.test.js

View workflow job for this annotation

GitHub Actions / eslint

'describe' is not defined
it('Can insert the block pattern', () => {

Check failure on line 2 in tests/cypress/integration/pmk-block-patterns.test.js

View workflow job for this annotation

GitHub Actions / eslint

'it' is not defined
cy.visitAdminPage('post-new.php');

Check failure on line 3 in tests/cypress/integration/pmk-block-patterns.test.js

View workflow job for this annotation

GitHub Actions / eslint

'cy' is not defined
cy.closeWelcomeGuide();

Check failure on line 4 in tests/cypress/integration/pmk-block-patterns.test.js

View workflow job for this annotation

GitHub Actions / eslint

'cy' is not defined
cy.get('#post-title-0, h1.editor-post-title__input')

Check failure on line 5 in tests/cypress/integration/pmk-block-patterns.test.js

View workflow job for this annotation

GitHub Actions / eslint

'cy' is not defined
.click({ force: true })
.type('Test Block Pattern');
cy.get(

Check failure on line 8 in tests/cypress/integration/pmk-block-patterns.test.js

View workflow job for this annotation

GitHub Actions / eslint

'cy' is not defined
'.edit-post-header-toolbar__inserter-toggle, .editor-document-tools__inserter-toggle',
).click();
cy.get(

Check failure on line 11 in tests/cypress/integration/pmk-block-patterns.test.js

View workflow job for this annotation

GitHub Actions / eslint

'cy' is not defined
'.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) => {

Check failure on line 18 in tests/cypress/integration/pmk-block-patterns.test.js

View workflow job for this annotation

GitHub Actions / eslint

'cy' is not defined
if ($body.find('.components-select-control__input').length > 0) {
cy.get('.components-select-control__input').select('publisher-media-kit', {

Check failure on line 20 in tests/cypress/integration/pmk-block-patterns.test.js

View workflow job for this annotation

GitHub Actions / eslint

'cy' is not defined
force: true,
});
} else if ($body.find('[aria-label="Publisher Media Kit"]').length > 0) {
cy.get('[aria-label="Publisher Media Kit"]').click();

Check failure on line 24 in tests/cypress/integration/pmk-block-patterns.test.js

View workflow job for this annotation

GitHub Actions / eslint

'cy' is not defined
}

// 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');
});
});
});

0 comments on commit b1ca754

Please sign in to comment.