influxdb/ui/cypress/e2e/dashboardsView.test.ts

57 lines
1.4 KiB
TypeScript
Raw Normal View History

import {Organization} from '@influxdata/influx'
describe('Dashboard', () => {
beforeEach(() => {
cy.flush()
cy.signin().then(({body}) => {
cy.wrap(body.org).as('org')
})
2019-04-01 19:07:29 +00:00
cy.fixture('routes').then(({orgs}) => {
cy.get<Organization>('@org').then(({id}) => {
cy.visit(`${orgs}/${id}/dashboards`)
})
})
})
it('can edit a dashboards name', () => {
cy.get<Organization>('@org').then(({id}) => {
cy.createDashboard(id).then(({body}) => {
2019-04-01 19:07:29 +00:00
cy.fixture('routes').then(({orgs}) => {
cy.visit(`${orgs}/${id}/dashboards/${body.id}`)
})
})
})
const newName = 'new 🅱ashboard'
cy.get('.renamable-page-title--title').click()
cy.get('.input-field')
.type(newName)
.type('{enter}')
2019-04-01 19:07:29 +00:00
cy.fixture('routes').then(({orgs}) => {
cy.get<Organization>('@org').then(({id}) => {
cy.visit(`${orgs}/${id}/dashboards`)
})
})
Inline Label Editing from Dashboards Index (#12384) * Use client generated Label in dashboard actions * Fetch labels when dashboards index loads * Add styles for "colorless" labels * Implement inline label editing from dashboard cards * Fine tune label deletion * Create createLabelAJAX function Co-Authored-By: Delmer <ofthedelmer@users.noreply.github.com> * Make inline label creation work in dashboards index Co-Authored-By: Delmer <ofthedelmer@users.noreply.github.com> * WIP use ILabel as the defacto label type * Ensure a label can be updated without having to change the name * Ensure all fields in a Label can be changed in the overlay * WIP write e2e tests for inline labelling Co-Authored-By: Andrew Watkins <121watts@users.noreply.github.com> * wip: dashboard brittle * wip dashboards * Position inline labels popover such that it doesn't collide with the navbar * chore: run all dashboard tests 25 times * Ensure that there is a dashboard with a name that matches the search test query * Appease the lint gods with mortal sacrifice * Remove unit test in favor of e2e test Everything the unit test is testing is also tested by the e2e test Co-Authored-By: Delmer <ofthedelmer@users.noreply.github.com> * Remove for loop and fix search name assertion Co-Authored-By: Delmer <ofthedelmer@users.noreply.github.com> Co-Authored-By: Andrew Watkins <121watts@users.noreply.github.com> * Fix affected task test Co-Authored-By: Delmer <ofthedelmer@users.noreply.github.com> Co-Authored-By: Andrew Watkins <121watts@users.noreply.github.com> * Fix incorrectly named reference in e2e test Co-Authored-By: Delmer <ofthedelmer@users.noreply.github.com> Co-Authored-By: Andrew Watkins <121watts@users.noreply.github.com> * Undo go file change * Add guard back in * Undo changes to go file
2019-03-08 17:11:30 +00:00
cy.getByTestID('dashboard-card').should('contain', newName)
})
it('can create a cell', () => {
cy.get<Organization>('@org').then(({id}) => {
cy.createDashboard(id).then(({body}) => {
2019-04-01 19:07:29 +00:00
cy.fixture('routes').then(({orgs}) => {
cy.visit(`${orgs}/${id}/dashboards/${body.id}`)
})
})
})
cy.getByTestID('add-cell--button').click()
cy.getByTestID('save-cell--button').click()
cy.getByTestID('cell--view-empty').should('have.length', 1)
})
})