1
0
mirror of https://github.com/nolanlawson/pinafore synced 2024-12-14 19:38:28 +01:00
Pinafore-Web-Client-Frontend/tests/spec/001-basic-spec.js
2018-03-06 21:32:51 -08:00

34 lines
1.0 KiB
JavaScript

import { Selector as $ } from 'testcafe'
import { getUrl, settingsButton } from '../utils'
fixture`001-basic-spec.js`
.page`http://localhost:4002`
test('has the correct <h1>', async t => {
await t
.expect($('.container h1').innerText).eql('Pinafore')
})
test('navigates to about', async t => {
await t
.click(settingsButton)
.expect(getUrl()).contains('/settings')
.click('a[href="/settings/about"]')
.expect(getUrl()).contains('/about')
.expect($('.container h1').innerText).eql('About Pinafore')
})
test('navigates to /settings/instances/add', async t => {
await t.click($('a').withText('log in to an instance'))
.expect(getUrl()).contains('/settings/instances/add')
})
test('navigates to settings/instances', async t => {
await t.click(settingsButton)
.expect(getUrl()).contains('/settings')
.click($('a').withText('Instances'))
.expect(getUrl()).contains('/settings/instances')
.expect($('.container').innerText)
.contains("You're not logged in to any instances")
})