diff --git a/cypress/integration/embauche/embauche.js b/cypress/integration/embauche/embauche.js index f645fa4d9..22a12733f 100644 --- a/cypress/integration/embauche/embauche.js +++ b/cypress/integration/embauche/embauche.js @@ -13,7 +13,7 @@ describe('Landing basic test', function() { }) it('should display the simulateur after loading', function() { cy.visit('/') - cy.contains('Touché par le salarié') + cy.contains('Touché sur le compte bancaire') }) it('should display cotisation repartition when entering net salary', function() { cy.visit('/') @@ -23,8 +23,10 @@ describe('Landing basic test', function() { it('should allow to navigate to a documentation page', function() { cy.visit('/') salaryInput('Salaire net').type('2000') - cy.contains("Total chargé").click() - cy.contains(`C'est le total que l'employeur doit verser pour employer un salarié`) + cy.contains('Total chargé').click() + cy.contains( + `C'est le total que l'employeur doit verser pour employer un salarié` + ) }) }) @@ -32,7 +34,7 @@ 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('CDD').click() cy.contains('passer').click() cy.contains('passer').click() // Wanted to use cypress.clock(), but can't because of piwik changing Date prototype (!) diff --git a/cypress/integration/embauche/external-integrations.js b/cypress/integration/embauche/external-integrations.js index a89f60cff..3c73de01c 100644 --- a/cypress/integration/embauche/external-integrations.js +++ b/cypress/integration/embauche/external-integrations.js @@ -7,6 +7,6 @@ describe('Pole emploi test', function() { cy.reload(true) cy.get('#simulateurEmbauche') .iframe() - .contains('Touché par le salarié') + .contains('Touché sur le compte bancaire') }) }) diff --git a/cypress/integration/embauche/iframe.js b/cypress/integration/embauche/iframe.js index 566bf0634..538189a23 100644 --- a/cypress/integration/embauche/iframe.js +++ b/cypress/integration/embauche/iframe.js @@ -3,6 +3,6 @@ describe('Iframe integration test', function() { cy.visit('/integration-test') cy.get('#simulateurEmbauche') .iframe() - .contains('Touché par le salarié') + .contains('Touché sur le compte bancaire') }) }) diff --git a/source/components/TargetSelection.js b/source/components/TargetSelection.js index 9e8cae903..538d974b6 100644 --- a/source/components/TargetSelection.js +++ b/source/components/TargetSelection.js @@ -17,14 +17,17 @@ import { analysisWithDefaultsSelector, blockingInputControlsSelector, flatRulesSelector, + nextStepsSelector, noUserInputSelector } from 'Selectors/analyseSelectors' import Animate from 'Ui/animate' import AnimatedTargetValue from 'Ui/AnimatedTargetValue' +import { Progress } from '../sites/mycompanyinfrance.fr/layout/ProgressHeader/ProgressHeader' import CurrencyInput from './CurrencyInput/CurrencyInput' import QuickLinks from './QuickLinks' import './TargetSelection.css' +const MAX_NUMBER_QUESTION = 18 export default compose( translate(), withColours, @@ -40,6 +43,9 @@ export default compose( analysis: analysisWithDefaultsSelector(state), blockingInputControls: blockingInputControlsSelector(state), flatRules: flatRulesSelector(state), + progress: + (100 * (MAX_NUMBER_QUESTION - nextStepsSelector(state))) / + MAX_NUMBER_QUESTION, noUserInput: noUserInputSelector(state), conversationStarted: state.conversationStarted, activeInput: state.activeTargetInput, @@ -55,12 +61,13 @@ export default compose( )( class TargetSelection extends Component { render() { - let { colours, analysis } = this.props + let { colours, analysis, progress } = this.props return (
+
{ +export const estimationProgressSelector = state => { const userInputProgress = +( !noUserInputSelector(state) && !softCatch(blockingInputControlsSelector)(state) diff --git a/source/sites/mycompanyinfrance.fr/layout/ProgressHeader/ProgressHeader.js b/source/sites/mycompanyinfrance.fr/layout/ProgressHeader/ProgressHeader.js index 254cc8ed1..58a0f0565 100644 --- a/source/sites/mycompanyinfrance.fr/layout/ProgressHeader/ProgressHeader.js +++ b/source/sites/mycompanyinfrance.fr/layout/ProgressHeader/ProgressHeader.js @@ -6,8 +6,8 @@ import withTracker from 'Components/utils/withTracker' import { compose } from 'ramda' import { withNamespaces } from 'react-i18next' import { connect } from 'react-redux' +import { withRouter } from 'react-router' import { NavLink } from 'react-router-dom' -import { withRouter } from "react-router"; import selectors from 'Selectors/progressSelectors' import companySvg from '../../images/company.svg' import estimateSvg from '../../images/estimate.svg' @@ -16,7 +16,7 @@ import './ProgressHeader.css' import type { Tracker } from 'Components/utils/withTracker' -const Progress = ({ percent }) => ( +export const Progress = ({ percent }: { percent: number }) => (
( }} />
- ) type OwnProps = {} type Props = OwnProps & { @@ -91,7 +90,7 @@ export default (compose( connect( selectors, {} - ), + ), withRouter, withNamespaces(), withSitePaths