Merge pull request #410 from betagouv/bugfixes

Bugfixes
pull/409/head
Johan Girod 2018-10-17 17:44:57 +02:00 committed by GitHub
commit 18023057ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 5 deletions

View File

@ -28,6 +28,21 @@ describe('Landing basic test', function() {
})
})
describe('Simulation saving test', function() {
it('should save the current simulation', async function() {
cy.visit('/')
salaryInput('Salaire net').type('5471')
cy.tick(500)
cy.contains('Autres').click()
cy.contains('passer').click()
cy.contains('passer').click()
cy.tick(2000).then(() => this.clock.restore)
cy.visit('/')
cy.contains('Retrouver ma simulation').click()
salaryInput('Salaire net').should('have.value', '5471')
})
})
describe('Iframe integration test', function() {
it('should display an iframe of the simulateur', function() {
cy.visit('/integration-test')

View File

@ -52,11 +52,17 @@ export class ScrollToElement extends Component {
) {
return
}
this.ref.scrollIntoView({
behavior: this.props.behavior,
block: 'nearest',
inline: 'nearest'
})
try {
this.ref.scrollIntoView({
behavior: this.props.behavior,
block: 'nearest',
inline: 'nearest'
})
} catch (error) {
this.ref.scrollIntoView({
behavior: this.props.behavior
})
}
}
componentDidMount() {
this.scrollIfNeeded()

View File

@ -19,6 +19,7 @@ import computeThemeColours from 'Ui/themeColours'
import { simulationTargetNames } from '../config.js'
import defaultLang from '../i18n'
import inFranceAppReducer from './inFranceAppReducer'
import storageReducer from './storageReducer'
import type { Action } from 'Types/ActionsTypes'
// TODO : use context API instead
@ -160,6 +161,7 @@ const existingCompanyReducer = (state, action) => {
}
export default reduceReducers(
existingCompanyReducer,
storageReducer,
combineReducers({
sessionId: defaultTo(Math.floor(Math.random() * 1000000000000) + ''),
// this is handled by redux-form, pas touche !