Skip to content

Commit

Permalink
fix eslint errors,
Browse files Browse the repository at this point in the history
/home/runner/work/publisher-media-kit/publisher-media-kit/tests/cypress/integration/pmk-block-patterns.test.js
Error:    1:1   error  'describe' is not defined                                                                                                                                                                                                                                                                                                                               no-undef
Error:    2:1   error  Replace `····` with `↹`                                                                                                                                                                                                                                                                                                                                 prettier/prettier
Error:    2:5   error  'it' is not defined                                                                                                                                                                                                                                                                                                                                     no-undef
Error:    3:1   error  Replace `········` with `↹↹`                                                                                                                                                                                                                                                                                                                            prettier/prettier
Error:    3:9   error  'cy' is not defined                                                                                                                                                                                                                                                                                                                                     no-undef
Error:    4:1   error  Replace `········` with `↹↹`                                                                                                                                                                                                                                                                                                                            prettier/prettier
Error:    4:9   error  'cy' is not defined                                                                                                                                                                                                                                                                                                                                     no-undef
Error:    5:1   error  Replace `········cy.get('#post-title-0,·h1.editor-post-title__input').click(·{·force:·true·}·)` with `↹↹cy.get('#post-title-0,·h1.editor-post-title__input')⏎↹↹↹.click({·force:·true·})⏎↹↹↹`                                                                                                                                                            prettier/prettier
Error:    5:9   error  'cy' is not defined                                                                                                                                                                                                                                                                                                                                     no-undef
Error:    6:1   error  Replace `········cy.get('.edit-post-header-toolbar__inserter-toggle,·.editor-document-tools__inserter-toggle'` with `↹↹cy.get(⏎↹↹↹'.edit-post-header-toolbar__inserter-toggle,·.editor-document-tools__inserter-toggle',⏎↹↹`                                                                                                                            prettier/prettier
Error:    6:9   error  'cy' is not defined                                                                                                                                                                                                                                                                                                                                     no-undef
Error:    7:1   error  Replace `········cy.get('.components-tab-panel__tabs·button,·.block-editor-inserter__tabs·button,·.block-editor-tabbed-sidebar__tablist·button').contains(·'Patterns'·)` with `↹↹cy.get(⏎↹↹↹'.components-tab-panel__tabs·button,·.block-editor-inserter__tabs·button,·.block-editor-tabbed-sidebar__tablist·button',⏎↹↹)⏎↹↹↹.contains('Patterns')⏎↹↹↹`  prettier/prettier
Error:    7:9   error  'cy' is not defined                                                                                                                                                                                                                                                                                                                                     no-undef
Error:    9:1   error  Replace `········` with `↹↹`                                                                                                                                                                                                                                                                                                                            prettier/prettier
Error:   10:1   error  Replace `········` with `↹↹`                                                                                                                                                                                                                                                                                                                            prettier/prettier
Error:   10:9   error  'cy' is not defined                                                                                                                                                                                                                                                                                                                                     no-undef
Error:   11:1   error  Replace `············` with `↹↹↹`                                                                                                                                                                                                                                                                                                                       prettier/prettier
Error:   12:1   error  Replace `················` with `↹↹↹↹`                                                                                                                                                                                                                                                                                                                  prettier/prettier
Error:   12:17  error  'cy' is not defined                                                                                                                                                                                                                                                                                                                                     no-undef
Error:   13:1   error  Replace `····················` with `↹↹↹↹↹`                                                                                                                                                                                                                                                                                                             prettier/prettier
Error:   14:1   error  Replace `················` with `↹↹↹↹`                                                                                                                                                                                                                                                                                                                  prettier/prettier
Error:   15:1   error  Replace `············}·else·if·($body.find(·'[aria-label="Publisher·Media·Kit"]'·` with `↹↹↹}·else·if·($body.find('[aria-label="Publisher·Media·Kit"]'`                                                                                                                                                                                                 prettier/prettier
Error:   16:1   error  Replace `················` with `↹↹↹↹`                                                                                                                                                                                                                                                                                                                  prettier/prettier
Error:   16:17  error  'cy' is not defined                                                                                                                                                                                                                                                                                                                                     no-undef
Error:   17:1   error  Replace `············` with `↹↹↹`                                                                                                                                                                                                                                                                                                                       prettier/prettier
Error:   19:1   error  Replace `············` with `↹↹↹`                                                                                                                                                                                                                                                                                                                       prettier/prettier
Error:   20:1   error  Replace `············` with `↹↹↹`                                                                                                                                                                                                                                                                                                                       prettier/prettier
Error:   20:13  error  'cy' is not defined                                                                                                                                                                                                                                                                                                                                     no-undef
Error:   21:1   error  Replace `········` with `↹↹`                                                                                                                                                                                                                                                                                                                            prettier/prettier
Error:   22:1   error  Replace `····` with `↹`                                                                                                                                                                                                                                                                                                                                 prettier/prettier
  • Loading branch information
faisal-alvi committed Dec 13, 2024
1 parent f010756 commit 1fbbdab
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"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-style": "10up-toolkit lint-style",
"test": "10up-toolkit test-unit-jest",
"wp-env": "wp-env",
Expand Down
30 changes: 15 additions & 15 deletions tests/cypress/integration/pmk-block-patterns.test.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
describe('Check if Media Kit Block Pattern is available for use', () => {
it('Can insert the block pattern', () => {
cy.visitAdminPage('post-new.php');
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

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

View workflow job for this annotation

GitHub Actions / eslint

Delete `·`
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

Replace `····it(·` with `↹it(`

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

Replace `········cy.visitAdminPage(·'post-new.php'·` with `↹↹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

Replace `········` with `↹↹`

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').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();
cy.get( '#post-title-0, h1.editor-post-title__input' ).click( { force: true } ).type( 'Test Block Pattern' );

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

View workflow job for this annotation

GitHub Actions / eslint

Replace `········cy.get(·'#post-title-0,·h1.editor-post-title__input'·).click(·{·force:·true·}·).type(·'Test·Block·Pattern'·` with `↹↹cy.get('#post-title-0,·h1.editor-post-title__input')⏎↹↹↹.click({·force:·true·})⏎↹↹↹.type('Test·Block·Pattern'`

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

0 comments on commit 1fbbdab

Please sign in to comment.