Ajoute un test pour le lien vers la page d'aide

Sideeffect: correction du bug window.scroll
pull/396/head
Johan Girod 2018-10-11 11:35:19 +02:00
parent 929c31fc35
commit 02fdc45dce
3 changed files with 15 additions and 5 deletions

View File

@ -20,6 +20,12 @@ describe('Landing basic test', function() {
salaryInput('Salaire net').type('2000')
cy.get('.distribution-chart__container')
})
it('should allow to navigate to the aid page', function() {
cy.visit('/')
salaryInput('Salaire net').type('2000')
cy.contains("d'aides").click()
cy.contains('Aides employeur')
})
})
describe('Iframe integration test', function() {

View File

@ -1,6 +1,6 @@
[[redirects]]
from = "https://embauche.beta.gouv.fr/stats"
to = "https://remarkable-ogre.glitch.me/"
to = "https://rough-college.glitch.me/"
status = 200
[[redirects]]

View File

@ -17,10 +17,14 @@ export class ScrollToTop extends Component {
return
}
forEachParent(this.ref, elem => (elem.scrollTop = 0))
window.scroll({
top: 0,
behavior: this.props.behavior
})
try {
window.scroll({
top: 0,
behavior: this.props.behavior
})
} catch (e) {
window.scroll(0, 0)
}
}
render() {
return (