pinafore/tests/spec/001-basic-spec.js
Nolan Lawson b7f5d04b4c
fix(scrolling): use body as scrolling container (#656)
* fix(scrolling): use body as scrolling container

Fixes #526

* fixup tests and focus
2018-11-17 18:06:49 -08:00

34 lines
1 KiB
JavaScript

import { Selector as $ } from 'testcafe'
import { getUrl, logInToInstanceLink, settingsButton } from '../utils'
fixture`001-basic-spec.js`
.page`http://localhost:4002`
test('has the correct <h1>', async t => {
await t
.expect($('.main-content 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($('.main-content h1').innerText).eql('About Pinafore')
})
test('navigates to /settings/instances/add', async t => {
await t.click(logInToInstanceLink)
.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($('.main-content').innerText)
.contains("You're not logged in to any instances")
})