Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions classes/views/shared/toggle.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
$use_container = false;

$aria_attrs = array();

if ( ! empty( $args['aria-label-attr'] ) ) {
$aria_attrs['aria-label'] = $args['aria-label-attr'];
} else {
Expand Down
11 changes: 11 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 14 additions & 6 deletions tests/cypress/e2e/Entries/EntriesPageDataValidations.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ describe( 'Entries submitted from a form', () => {
cy.get( '#frm-save-form-name-button' ).should( 'contain', 'Save' ).click();

cy.log( `Create a text field` );
cy.get( `li[id="text"] a[title="Text"]` ).click( { force: true } );
// Plain, always-visible sidebar link - no hover gating involved.
cy.get( `li[id="text"] a[title="Text"]` ).should( 'be.visible' ).click();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Template string can be replaced with regular string literal


Template literals are useful when you need: 1. Interpolated strings.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Template string can be replaced with regular string literal


Template literals are useful when you need: 1. Interpolated strings.


cy.log( 'Update form' );
cy.get( '#frm_submit_side_top' ).should( 'contain', 'Update' ).click();
Expand Down Expand Up @@ -74,7 +75,7 @@ describe( 'Entries submitted from a form', () => {
} );

cy.get( '.frm_form_nav > :nth-child(1) > a' ).should( 'contain', 'Build' ).click();
cy.get( "a[aria-label='Close']", { timeout: 5000 } ).click( { force: true } );
cy.get( "a[aria-label='Close']", { timeout: 5000 } ).should( 'be.visible' ).click();
cy.log( 'Verify that entries are not allowed from the forms list' );
cy.get( 'td[data-colname="Entries"] svg[title="Saving entries is disabled for this form"]' ).should( 'exist' );
} );
Expand All @@ -88,7 +89,8 @@ describe( 'Entries submitted from a form', () => {
cy.get( '#frm-save-form-name-button' ).should( 'contain', 'Save' ).click();

cy.log( `Create a text field` );
cy.get( `li[id="text"] a[title="Text"]` ).click( { force: true } );
// Plain, always-visible sidebar link - no hover gating involved.
cy.get( `li[id="text"] a[title="Text"]` ).should( 'be.visible' ).click();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Template string can be replaced with regular string literal


Template literals are useful when you need: 1. Interpolated strings.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Template string can be replaced with regular string literal


Template literals are useful when you need: 1. Interpolated strings.


cy.log( 'Update form' );
cy.get( '#frm_submit_side_top' ).should( 'contain', 'Update' ).click();
Expand Down Expand Up @@ -130,9 +132,15 @@ describe( 'Entries submitted from a form', () => {
cy.get( 'td[data-colname="IP"]' ).should( 'exist' );

cy.log( 'Click on View' );
cy.get( 'tr div.row-actions span.view a', { timeout: 5000 } )
// WP core only reveals row-actions on a real CSS `:hover` (`.row-actions` is
// `position: relative; left: -9999em` until `tr:hover`) - make it actionable the way the
// real hover would, then click normally. Chained in one continuous command so there's no
// window between the reset and the click for a re-render to undo it.
cy.get( 'tr div.row-actions', { timeout: 5000 } )
.invoke( 'css', 'position', 'static' )
.find( 'span.view a' )
.should( 'contain', 'View' )
.click( { force: true } );
.click();

cy.url().should( 'include', 'frm_action=show&id=' );

Expand Down Expand Up @@ -188,7 +196,7 @@ describe( 'Entries submitted from a form', () => {
cy.get( '.frm_no_entries_header' ).should( 'contain', 'No Entries for form: Test Form' );

cy.get( '.frm_form_nav > :nth-child(1) > a' ).should( 'contain', 'Build' ).click();
cy.get( "a[aria-label='Close']", { timeout: 5000 } ).click( { force: true } );
cy.get( "a[aria-label='Close']", { timeout: 5000 } ).should( 'be.visible' ).click();
} );

afterEach( () => {
Expand Down
23 changes: 16 additions & 7 deletions tests/cypress/e2e/Entries/deleteEntries.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ describe( 'Entries submitted from a form', () => {
cy.get( '#frm-save-form-name-button' ).should( 'contain', 'Save' ).click();

cy.log( `Add some fields` );
cy.get( 'li[id="text"] a[title="Text"]' ).click( { force: true } );
cy.get( 'li[id="name"] a[title="Name"]' ).click( { force: true } );
cy.get( 'li[id="checkbox"] a[title="Checkboxes"]' ).click( { force: true } );
cy.get( 'li[id="email"] a[title="Email"]' ).click( { force: true } );
cy.get( 'li[id="phone"] a[title="Phone"]' ).click( { force: true } );
// Plain, always-visible sidebar links - no hover gating involved.
cy.get( 'li[id="text"] a[title="Text"]' ).should( 'be.visible' ).click();
cy.get( 'li[id="name"] a[title="Name"]' ).should( 'be.visible' ).click();
cy.get( 'li[id="checkbox"] a[title="Checkboxes"]' ).should( 'be.visible' ).click();
cy.get( 'li[id="email"] a[title="Email"]' ).should( 'be.visible' ).click();
cy.get( 'li[id="phone"] a[title="Phone"]' ).should( 'be.visible' ).click();

cy.log( 'Update form' );
cy.get( '#frm_submit_side_top' ).should( 'contain', 'Update' ).click();
Expand Down Expand Up @@ -55,15 +56,23 @@ describe( 'Entries submitted from a form', () => {
cy.go( 'back' );
cy.contains( '#the-list tr', 'Entry test' ).trigger( 'mouseover' ).then( $row => {
cy.wrap( $row ).within( () => {
cy.get( '.row-actions .delete .submitdelete' ).should( 'be.visible' ).click( { force: true } );
// WP core only reveals row-actions on a real CSS `:hover` (`.row-actions` is
// `position: relative; left: -9999em` until `tr:hover`) - make it actionable the
// way the real hover would, then click normally. Chained in one continuous command
// so there's no window between the reset and the click for a re-render to undo it.
cy.get( '.row-actions' )
.invoke( 'css', 'position', 'static' )
.find( '.delete .submitdelete' )
.should( 'be.visible' )
.click();
} );
} );
cy.contains( '.frm-confirm-msg', 'Permanently delete this entry?' );
cy.get( '#frm-confirmed-click' ).should( 'contain', 'Confirm' ).click();

cy.log( 'Teardown - Close and delete form' );
cy.get( '.frm_form_nav > :nth-child(1) > a' ).should( 'contain', 'Build' ).click();
cy.get( "a[aria-label='Close']", { timeout: 5000 } ).click( { force: true } );
cy.get( "a[aria-label='Close']", { timeout: 5000 } ).should( 'be.visible' ).click();
cy.deleteForm();
} );
} );
Loading
Loading