Pinafore-Web-Client-Frontend/tests/spec/020-themes.js

23 lines
636 B
JavaScript
Raw Normal View History

2018-04-21 09:33:42 +02:00
import {
getCurrentTheme,
2018-04-21 09:33:42 +02:00
settingsNavButton
} from '../utils'
import { loginAsFoobar } from '../roles'
2018-04-21 09:33:42 +02:00
import { Selector as $ } from 'testcafe'
fixture`020-themes.js`
.page`http://localhost:4002`
test('can set a theme', async t => {
await loginAsFoobar(t)
await t
2018-04-21 09:33:42 +02:00
.click(settingsNavButton)
.click($('a[href="/settings/instances"]'))
.click($('a[href="/settings/instances/localhost:3000"]'))
.expect(getCurrentTheme()).eql('default')
2018-04-21 09:33:42 +02:00
.click($('input[value="scarlet"]'))
.expect(getCurrentTheme()).eql('scarlet')
2018-04-21 09:33:42 +02:00
.click($('input[value="default"]'))
.expect(getCurrentTheme()).eql('default')
2018-04-21 09:33:42 +02:00
})