2020-12-10 14:52:35 +01:00
|
|
|
import {UserFactory} from '../../factories/user'
|
|
|
|
|
|
|
|
import '../../support/authenticateUser'
|
|
|
|
import {ListFactory} from '../../factories/list'
|
|
|
|
import {NamespaceFactory} from '../../factories/namespace'
|
|
|
|
|
|
|
|
describe('Namepaces', () => {
|
|
|
|
let namespaces
|
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
UserFactory.create(1)
|
|
|
|
namespaces = NamespaceFactory.create(1)
|
|
|
|
ListFactory.create(1)
|
|
|
|
})
|
|
|
|
|
|
|
|
it('Should be all there', () => {
|
|
|
|
cy.visit('/namespaces')
|
|
|
|
cy.get('.namespace h1 span')
|
|
|
|
.should('contain', namespaces[0].title)
|
|
|
|
})
|
|
|
|
|
|
|
|
it('Should create a new Namespace', () => {
|
|
|
|
cy.visit('/namespaces')
|
|
|
|
cy.get('a.button')
|
2021-01-17 12:15:57 +01:00
|
|
|
.contains('Create namespace')
|
2020-12-10 14:52:35 +01:00
|
|
|
.click()
|
|
|
|
cy.url()
|
|
|
|
.should('contain', '/namespaces/new')
|
2021-01-21 23:33:16 +01:00
|
|
|
cy.get('.card-header-title')
|
2020-12-10 14:52:35 +01:00
|
|
|
.should('contain', 'Create a new namespace')
|
|
|
|
cy.get('input.input')
|
|
|
|
.type('New Namespace')
|
2021-01-17 18:57:57 +01:00
|
|
|
cy.get('.button')
|
2021-01-21 23:33:16 +01:00
|
|
|
.contains('Create')
|
2020-12-10 14:52:35 +01:00
|
|
|
.click()
|
|
|
|
cy.url()
|
|
|
|
.should('contain', '/namespaces')
|
|
|
|
})
|
|
|
|
})
|