2019-07-29 21:41:32 +00:00
|
|
|
|
import {Organization} from '../../src/types'
|
2019-02-26 01:41:18 +00:00
|
|
|
|
|
|
|
|
|
describe('Dashboard', () => {
|
|
|
|
|
beforeEach(() => {
|
|
|
|
|
cy.flush()
|
|
|
|
|
|
2019-02-26 22:05:53 +00:00
|
|
|
|
cy.signin().then(({body}) => {
|
2019-02-26 01:41:18 +00:00
|
|
|
|
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`)
|
|
|
|
|
})
|
2019-02-26 01:41:18 +00:00
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
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}`)
|
|
|
|
|
})
|
2019-02-26 01:41:18 +00:00
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const newName = 'new 🅱️ashboard'
|
|
|
|
|
|
|
|
|
|
cy.get('.renamable-page-title--title').click()
|
2019-07-25 19:13:51 +00:00
|
|
|
|
cy.get('.cf-input-field')
|
2019-02-26 01:41:18 +00:00
|
|
|
|
.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`)
|
|
|
|
|
})
|
|
|
|
|
})
|
2019-02-26 01:41:18 +00:00
|
|
|
|
|
2019-03-08 17:11:30 +00:00
|
|
|
|
cy.getByTestID('dashboard-card').should('contain', newName)
|
2019-02-26 01:41:18 +00:00
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
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}`)
|
|
|
|
|
})
|
2019-02-26 01:41:18 +00:00
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
cy.getByTestID('add-cell--button').click()
|
|
|
|
|
cy.getByTestID('save-cell--button').click()
|
|
|
|
|
cy.getByTestID('cell--view-empty').should('have.length', 1)
|
|
|
|
|
})
|
|
|
|
|
})
|