1
0
mirror of https://github.com/nolanlawson/pinafore synced 2024-12-12 18:28:03 +01:00
Pinafore-Web-Client-Frontend/tests/spec/020-themes.js
Nolan Lawson 48a1bd47b3
refactor(themes): use CSS specificity order for themes (#684)
The point of this PR is to make it easier to implement scrollbars (#683).

With this PR, the themes move from a body tag-based system (e.g. `body.theme-scarlet`) to a system where they simply declare global CSS and we use CSS specificity order to give us the right theme.
2018-11-24 00:41:36 -08:00

23 lines
636 B
JavaScript

import {
getCurrentTheme,
settingsNavButton
} from '../utils'
import { loginAsFoobar } from '../roles'
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
.click(settingsNavButton)
.click($('a[href="/settings/instances"]'))
.click($('a[href="/settings/instances/localhost:3000"]'))
.expect(getCurrentTheme()).eql('default')
.click($('input[value="scarlet"]'))
.expect(getCurrentTheme()).eql('scarlet')
.click($('input[value="default"]'))
.expect(getCurrentTheme()).eql('default')
})