test(cypress): add basic Admin Chronograf tab test

pull/5911/head
k3yi0 2022-04-28 11:46:34 +02:00
parent 9afa26a29e
commit f80113c58d
2 changed files with 23 additions and 1 deletions

View File

@ -2,5 +2,6 @@
"dashboards": "/dashboards",
"hosts": "/hosts",
"explorer": "/data-explorer",
"config": "/manage-sources"
"config": "/manage-sources",
"adminChronograf": "/admin-chronograf"
}

View File

@ -0,0 +1,21 @@
describe('Use Admin tab', () => {
beforeEach(() => {
cy.OAuthLogin('test')
cy.removeConnections()
cy.createConnection()
cy.get('@connections').then(connections => {
cy.fixture('routes').then(({adminChronograf}) => {
cy.visit(`/sources/${connections[0].id}${adminChronograf}/current-organization`)
})
})
})
it('visit Admin tab and click around', () => {
cy.get('.chronograf-admin-table--user').should('exist').and('contain.text', 'test@oauth2.mock')
cy.get('.subsection--tab').contains('All Users').click({force: true})
cy.get('.chronograf-admin-table--user').should('exist').and('contain.text', 'test@oauth2.mock')
cy.get('.chronograf-admin-table--user').within(() => {
cy.get('.slide-toggle').should('have.class', 'active').and('have.class', 'disabled')
})
})
})