Update testcafe to the latest version 🚀 (#370)

* chore(package): update testcafe to version 0.20.3

* package-lock update

* make theme test pass
This commit is contained in:
greenkeeper[bot] 2018-06-07 15:26:21 -07:00 committed by Nolan Lawson
parent 4d3161cc95
commit 708340502d
4 changed files with 621 additions and 538 deletions

1148
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -101,7 +101,7 @@
"eslint-plugin-html": "^4.0.3",
"now": "^11.2.1",
"standard": "^11.0.1",
"testcafe": "0.19.1"
"testcafe": "0.20.3"
},
"engines": {
"node": ">= 8"

View File

@ -1,4 +1,5 @@
import {
getBodyClassList,
settingsNavButton
} from '../utils'
import { loginAsFoobar } from '../roles'
@ -13,9 +14,9 @@ test('can set a theme', async t => {
.click(settingsNavButton)
.click($('a[href="/settings/instances"]'))
.click($('a[href="/settings/instances/localhost:3000"]'))
.expect($('body').getAttribute('class')).eql(undefined)
.expect(getBodyClassList()).eql([])
.click($('input[value="scarlet"]'))
.expect($('body').getAttribute('class')).eql('theme-scarlet')
.expect(getBodyClassList()).eql(['theme-scarlet'])
.click($('input[value="default"]'))
.expect($('body').getAttribute('class')).eql('')
.expect(getBodyClassList()).eql([])
})

View File

@ -86,6 +86,8 @@ export const getComposeSelectionStart = exec(() => composeInput().selectionStart
dependencies: { composeInput }
})
export const getBodyClassList = exec(() => Array.prototype.slice.apply(document.body.classList))
export const scrollContainerToTop = exec(() => {
document.getElementsByClassName('container')[0].scrollTop = 0
})