pinafore/cypress/integration/01-basic-spec.js

32 lines
914 B
JavaScript
Raw Normal View History

2018-02-19 18:34:36 +00:00
describe('01-basic-spec.js', () => {
2018-02-18 23:30:42 +00:00
beforeEach(() => {
cy.visit('/')
2018-02-19 01:54:38 +00:00
cy.wait(500)
2018-02-18 23:30:42 +00:00
})
2018-01-06 23:51:25 +00:00
2018-02-18 23:30:42 +00:00
it('has the correct <h1>', () => {
cy.contains('h1', 'Pinafore')
})
2018-01-06 23:51:25 +00:00
2018-02-18 22:31:28 +00:00
it('navigates to about', () => {
2018-02-19 01:28:08 +00:00
cy.get('nav a[aria-label=Settings]').click()
2018-02-18 22:31:28 +00:00
cy.url().should('contain', '/settings')
cy.get('a').contains('About').click()
cy.url().should('contain', '/settings/about')
cy.contains('h1', 'About Pinafore')
})
2018-02-18 23:30:42 +00:00
it('navigates to /settings/instances/add', () => {
cy.contains('log in to an instance').click()
cy.url().should('contain', '/settings/instances/add')
})
2018-01-06 23:51:25 +00:00
2018-02-18 20:25:59 +00:00
it('navigates to settings/instances', () => {
2018-02-19 01:28:08 +00:00
cy.get('nav a[aria-label=Settings]').click()
2018-02-18 20:25:59 +00:00
cy.url().should('contain', '/settings')
cy.get('a').contains('Instances').click()
cy.url().should('contain', '/settings/instances')
cy.contains("You're not logged in to any instances")
})
2018-02-18 23:30:42 +00:00
})