Merge pull request #411 from betagouv/bugfixes

Bugfixes
pull/413/head
Johan Girod 2018-10-18 17:40:25 +02:00 committed by GitHub
commit c8e6b260b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 10 deletions

View File

@ -28,6 +28,21 @@ describe('Landing basic test', function() {
})
})
describe('Simulation saving test', function() {
it('should save the current simulation', function() {
cy.visit('/')
salaryInput('Salaire net').type('5471')
cy.contains('Autres').click()
cy.contains('passer').click()
cy.contains('passer').click()
// Wanted to use cypress.clock(), but can't because of piwik changing Date prototype (!)
cy.wait(1100)
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

@ -160,15 +160,12 @@
</script>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=default,Intl.~locale.en,Intl.~locale.fr,IntersectionObserver,fetch,Array.prototype.find,Object.values,Number.parseFloat,Array.prototype.includes,Object.entries,Object.values,Object.keys,Math.log2&unknown=polyfill"></script>
<script src="https://use.fontawesome.com/1da10bbdec.js"></script>
<script type="text/javascript">
if (/MSIE \d|Trident.*rv:/.test(navigator.userAgent)) {
// For ie, polyfill everything, as I can't figure what's going on, and which polyfill is missing...
document.write('<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=all"><\/script>');
} else {
document.write(
'<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=default,Intl.~locale.en,Intl.~locale.fr,IntersectionObserver,fetch,Array.prototype.find,Object.values,Number.parseFloat,Array.prototype.includes,Object.entries,Object.values,Object.keys,Math.log2&unknown=polyfill"><\/script>');
}
</script>

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,8 +19,8 @@ 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
function themeColours(state = computeThemeColours(), { type, colour }) {
if (type == 'CHANGE_THEME_COLOUR') return computeThemeColours(colour)
@ -160,6 +160,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 !