fix(cypress): User table column tests

Signed-off-by: Christopher Ng <chrng8@gmail.com>
This commit is contained in:
Christopher Ng 2023-10-04 17:54:42 -07:00
parent 14cb7b926c
commit 8a31efb644

View file

@ -49,12 +49,12 @@ describe('Settings: Show and hide columns', function() {
it('Can show a column', function() {
// see that the language column is not in the header
cy.get(`.user-list__header tr`).within(() => {
cy.get('.user-list__header tr').within(() => {
cy.contains('Language').should('not.exist')
})
// see that the language column is not in all user rows
cy.get(`tbody.user-list__body tr`).each(($row) => {
cy.get('tbody.user-list__body tr').each(($row) => {
cy.wrap($row).get('[data-test="language"]').should('not.exist')
})
@ -72,24 +72,24 @@ describe('Settings: Show and hide columns', function() {
cy.waitUntil(() => cy.get('.modal-container').should(el => assertNotExistOrNotVisible(el)))
// see that the language column is in the header
cy.get(`.user-list__header tr`).within(() => {
cy.get('.user-list__header tr').within(() => {
cy.contains('Language').should('exist')
})
// see that the language column is in all user rows
cy.get(`tbody.user-list__body tr`).each(($row) => {
cy.get('tbody.user-list__body tr').each(($row) => {
cy.wrap($row).get('[data-test="language"]').should('exist')
})
})
it('Can hide a column', function() {
// see that the last login column is in the header
cy.get(`.user-list__header tr`).within(() => {
cy.get('.user-list__header tr').within(() => {
cy.contains('Last login').should('exist')
})
// see that the last login column is in all user rows
cy.get(`tbody.user-list__body tr`).each(($row) => {
cy.get('tbody.user-list__body tr').each(($row) => {
cy.wrap($row).get('[data-test="lastLogin"]').should('exist')
})
@ -107,12 +107,12 @@ describe('Settings: Show and hide columns', function() {
cy.waitUntil(() => cy.get('.modal-container').should(el => assertNotExistOrNotVisible(el)))
// see that the last login column is not in the header
cy.get(`.user-list__header tr`).within(() => {
cy.get('.user-list__header tr').within(() => {
cy.contains('Last login').should('not.exist')
})
// see that the last login column is not in all user rows
cy.get(`tbody.user-list__body tr`).each(($row) => {
cy.get('tbody.user-list__body tr').each(($row) => {
cy.wrap($row).get('[data-test="lastLogin"]').should('not.exist')
})
})