From f80113c58d93e2de01bef366543d271693792560 Mon Sep 17 00:00:00 2001 From: k3yi0 Date: Thu, 28 Apr 2022 11:46:34 +0200 Subject: [PATCH] test(cypress): add basic Admin Chronograf tab test --- ui/cypress/fixtures/routes.json | 3 ++- .../integration/chronografAdmin.test.ts | 21 +++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 ui/cypress/integration/chronografAdmin.test.ts diff --git a/ui/cypress/fixtures/routes.json b/ui/cypress/fixtures/routes.json index 7f85d200c..d27b714ac 100644 --- a/ui/cypress/fixtures/routes.json +++ b/ui/cypress/fixtures/routes.json @@ -2,5 +2,6 @@ "dashboards": "/dashboards", "hosts": "/hosts", "explorer": "/data-explorer", - "config": "/manage-sources" + "config": "/manage-sources", + "adminChronograf": "/admin-chronograf" } diff --git a/ui/cypress/integration/chronografAdmin.test.ts b/ui/cypress/integration/chronografAdmin.test.ts new file mode 100644 index 000000000..66e6ff5c4 --- /dev/null +++ b/ui/cypress/integration/chronografAdmin.test.ts @@ -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') + }) + }) +}) \ No newline at end of file