test(buckets): use aliases for bucket object

pull/12099/head
Alirie Gray 2019-02-21 14:17:50 -08:00 committed by Andrew Watkins
parent c76fd8ffba
commit 771a7969de
1 changed files with 14 additions and 10 deletions

View File

@ -1,19 +1,21 @@
import {Bucket} from '@influxdata/influx'
describe('Buckets', () => {
let orgID: string = ''
let bucketName: string = ''
beforeEach(() => {
cy.flush()
cy.setupUser().then(({body}) => {
const {org, bucket} = body
orgID = org.id
bucketName = bucket.name
const {
org: {id},
bucket,
} = body
cy.wrap(bucket).as('bucket')
cy.signin(orgID)
})
cy.signin(id)
cy.fixture('routes').then(({orgs}) => {
cy.visit(`${orgs}/${orgID}/buckets_tab`)
cy.fixture('routes').then(({orgs}) => {
cy.visit(`${orgs}/${id}/buckets_tab`)
})
})
})
@ -38,7 +40,9 @@ describe('Buckets', () => {
it('can update a buckets name and retention rules', () => {
const newName = 'newdefbuck'
cy.contains(bucketName).click()
cy.get<Bucket>('@bucket').then(({name}) => {
cy.contains(name).click()
})
cy.getByDataTest('retention-intervals').click()