Skip to content
Merged
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
8 changes: 4 additions & 4 deletions composer.lock

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

24 changes: 12 additions & 12 deletions cypress/e2e/view-filtering-selection-row-removal.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,18 @@ describe('Filtering in a view by selection columns (Cypress supplement – row r
})

it('Filter view remove row when it no longer matches filter', () => {
const waitForRowPresenceCheck = (alias, rowId, expectedPresent, retries = 10) => {
cy.wait(alias).then(({ request, response }) => {
const waitForRowPresenceCheck = (alias, rowId, expectedPresent, retries = 20) => {
cy.wait(alias, { timeout: 20000 }).then(({ request, response }) => {
if (request.url.includes(`/row/${rowId}/present`)) {
expect(response.body.present).to.equal(expectedPresent)
if (response.body.present === expectedPresent) {
return
}

if (retries <= 0) {
expect(response.body.present).to.equal(expectedPresent)
}

waitForRowPresenceCheck(alias, rowId, expectedPresent, retries - 1)
return
}

Expand Down Expand Up @@ -162,15 +170,11 @@ describe('Filtering in a view by selection columns (Cypress supplement – row r
// # edit checked row
// ## uncheck
cy.intercept({ method: 'PUT', url: '**/apps/tables/row/*' }).as('updateCheckedRow')
cy.intercept({ method: 'GET', url: '**/apps/tables/view/*/row/*/present' }).as('isRowInViewPresentAfterEdit')
cy.contains('[data-cy="ncTable"] [data-cy="customTableRow"]', 'checked row').closest('[data-cy="customTableRow"]').find('[data-cy="editRowBtn"]').click()
cy.get('[data-cy="editRowModal"] .checkbox-radio-switch').click()
cy.get('[data-cy="editRowSaveButton"]').click()

cy.wait('@updateCheckedRow')
cy.then(() => {
waitForRowPresenceCheck('@isRowInViewPresentAfterEdit', checkedRowId, false)
})

// ## check if row does not exist
cy.contains('[data-cy="ncTable"] [data-cy="customTableRow"]', 'checked row').should('not.exist')
Expand All @@ -179,13 +183,9 @@ describe('Filtering in a view by selection columns (Cypress supplement – row r
// # inline edit row
// ## uncheck row
cy.intercept({ method: 'PUT', url: '**/apps/tables/row/*' }).as('inlineUpdateRow')
cy.intercept({ method: 'GET', url: '**/apps/tables/view/*/row/*/present' }).as('isRowInViewPresentAfterInlineEdit')
cy.contains('[data-cy="ncTable"] [data-cy="customTableRow"]', 'first row').closest('[data-cy="customTableRow"]').find('.inline-editing-container input').click({ force: true })

cy.wait('@inlineUpdateRow').then(({ request }) => {
const inlineUpdatedRowId = request.url.split('/').pop()
waitForRowPresenceCheck('@isRowInViewPresentAfterInlineEdit', inlineUpdatedRowId, false)
})
cy.wait('@inlineUpdateRow')

// ## check if row does not exist
cy.contains('[data-cy="ncTable"] [data-cy="customTableRow"]', 'first row').should('not.exist')
Expand Down
Loading