Ajoute un test end to end pour la sauvegarde de la simulation

pull/411/head
Johan Girod 2018-10-17 13:33:22 +02:00
parent 3ac18b04c8
commit 56903fcfec
3 changed files with 18 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', 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

@ -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 !