Fix integration tests

This commit is contained in:
Alexander Tseung 2018-04-04 18:21:30 -07:00
parent 7776af7cd0
commit 037d6e6624
3 changed files with 28 additions and 7 deletions

View File

@ -36,15 +36,28 @@ log.setLevel('debug')
//
const qs = require('qs')
let queryString = qs.parse(window.location.href.split('#')[1])
let selectedView = queryString.view || 'first time'
const routerPath = window.location.href.split('#')[1]
let queryString = {}
let selectedView
if (routerPath) {
queryString = qs.parse(routerPath.split('?')[1])
}
selectedView = queryString.view || 'first time'
const firstState = states[selectedView]
updateQueryParams(selectedView)
function updateQueryParams(newView) {
function updateQueryParams (newView) {
queryString.view = newView
const params = qs.stringify(queryString)
window.location.href = window.location.href.split('#')[0] + `#${params}`
const locationPaths = window.location.href.split('#')
const routerPath = locationPaths[1] || ''
const newPath = locationPaths[0] + '#' + routerPath.split('?')[0] + `?${params}`
if (window.location.href !== newPath) {
window.location.href = newPath
}
}
//

View File

@ -6,7 +6,7 @@ import classnames from 'classnames'
import shuffle from 'lodash.shuffle'
import { compose } from 'recompose'
import Identicon from '../../../../ui/app/components/identicon'
import { confirmSeedWords } from '../../../../ui/app/actions'
import { confirmSeedWords, showModal } from '../../../../ui/app/actions'
import Breadcrumbs from './breadcrumbs'
import LoadingScreen from './loading-screen'
import { DEFAULT_ROUTE } from '../../../../ui/app/routes'
@ -18,6 +18,7 @@ class ConfirmSeedScreen extends Component {
seedWords: PropTypes.string,
confirmSeedWords: PropTypes.func,
history: PropTypes.object,
openBuyEtherModal: PropTypes.func,
};
static defaultProps = {
@ -42,10 +43,13 @@ class ConfirmSeedScreen extends Component {
}
handleClick () {
const { confirmSeedWords, history } = this.props
const { confirmSeedWords, history, openBuyEtherModal } = this.props
confirmSeedWords()
.then(() => history.push(DEFAULT_ROUTE))
.then(() => {
history.push(DEFAULT_ROUTE)
openBuyEtherModal()
})
}
render () {
@ -141,6 +145,7 @@ export default compose(
}),
dispatch => ({
confirmSeedWords: () => dispatch(confirmSeedWords()),
openBuyEtherModal: () => dispatch(showModal({ name: 'DEPOSIT_ETHER'})),
})
)
)(ConfirmSeedScreen)

View File

@ -13,6 +13,9 @@ async function runFirstTimeUsageTest (assert, done) {
await skipNotices(app)
const welcomeButton = (await findAsync(app, '.welcome-screen__button'))[0]
welcomeButton.click()
// Scroll through terms
const title = (await findAsync(app, '.create-password__title')).text()
assert.equal(title, 'Create Password', 'create password screen')