pinafore/routes/settings/quick-login.html
Nolan Lawson e8d2cd9ffc
tests: quicker login, tweak test setup (#372)
* make tests faster by logging in directly

* downgrade testcafe

* Revert "downgrade testcafe"

This reverts commit 0f78f5ef63f25b6428de2faba476a353a338c695.

* try a delay

* the delay does not do anything

* disable concurrency in testcafe

* make setup script less noisy

* try transparency of 2?

* Revert "the delay does not do anything"

This reverts commit 438b3519a4e0c325e89f0c2a0eff6a7a4ae11ebd.

* try a delay of 400ms

* okay fine delay of 1s

* try concurrency of 4 again
2018-06-08 09:00:20 -07:00

32 lines
820 B
HTML

<!-- this is only used in the tests, to log in quickly -->
<script>
import { store } from '../_store/store'
import { goto } from 'sapper/runtime.js'
export default {
oncreate () {
let accessToken = location.search.match(/accessToken=([^&]+)/)[1]
let instanceName = location.search.match(/instanceName=([^&]+)/)[1]
let {
loggedInInstances,
loggedInInstancesInOrder
} = store.get()
loggedInInstances[instanceName] = {
access_token: accessToken
}
if (!loggedInInstancesInOrder.includes(instanceName)) {
loggedInInstancesInOrder.push(instanceName)
}
store.set({
currentInstance: instanceName,
loggedInInstances,
loggedInInstancesInOrder
})
store.save()
goto('/')
}
}
</script>