Skip to content

Commit

Permalink
fix(frontend): show age question on ccn 44 (#950)
Browse files Browse the repository at this point in the history
* fix(frontend): show age question on ccn 44

fix #943

* typofix

* rm useless import

* fix: fix snapshot
  • Loading branch information
lionelB authored Jun 19, 2019
1 parent 4e97b60 commit 00ff373
Show file tree
Hide file tree
Showing 3 changed files with 345 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React from "react";
import { Field } from "react-final-form";
import { Container } from "@cdt/ui";
import { EchelonChimie } from "./EchelonChimie";
import { TextQuestion } from "../../components/TextQuestion";
import { YesNoQuestion } from "../../components/YesNoQuestion";
import { TextQuestion } from "../../components/TextQuestion";

function Step_Chimie() {
return (
Expand All @@ -25,18 +25,16 @@ function Step_Chimie() {
name="isEco"
label="Le motif de votre licenciement est-il économique ?"
/>
{anciennete > 5 && (
<TextQuestion
inputType="number"
name="age"
label="Quel etait votre âge à la date du licenciement ?"
/>
)}
</>
);
}
if (anciennete > 5) {
return (
<TextQuestion
inputType="number"
name="age"
label="Quel etait votre age à la date du licenciementnbsp;?"
/>
);
}
return null;
}}
</Field>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe("<Step_0044 />", () => {
);
expect(container).toMatchSnapshot();
});
it("should ask for ope and licenciement eco", () => {
it("should ask for ope and licenciement eco and age", () => {
const onSubmit = jest.fn();
const { container } = render(
<Form
Expand All @@ -22,4 +22,15 @@ describe("<Step_0044 />", () => {
);
expect(container).toMatchSnapshot();
});
it("should ask for ope and licenciement eco", () => {
const onSubmit = jest.fn();
const { container } = render(
<Form
onSubmit={onSubmit}
initialValues={{ anciennete: 1.5 }}
render={() => <Step_0044 />}
/>
);
expect(container).toMatchSnapshot();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,331 @@ exports[`<Step_0044 /> should ask for ope and licenciement eco 1`] = `
</div>
`;

exports[`<Step_0044 /> should ask for ope and licenciement eco and age 1`] = `
.c0 {
max-width: 1200px;
margin: 0 auto;
padding: 0 1.25rem;
}
.c0 > *:last-child {
margin-top: 0;
margin-bottom: 0;
}
.c7 {
padding: 0;
font-size: 1rem;
text-align: center;
line-height: inherit;
width: NaNem;
border-radius: 0.25rem;
border: 1px solid #c9d3df;
padding: 0.625rem 0.25rem;
border-color: #c9d3df;
}
.c1 {
padding: 0;
text-align: center;
font-size: 1.15rem;
margin-right: 2em;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}
.c4 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: start;
-webkit-justify-content: flex-start;
-ms-flex-pack: start;
justify-content: flex-start;
-webkit-align-items: flex-start;
-webkit-box-align: flex-start;
-ms-flex-align: flex-start;
align-items: flex-start;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
margin-bottom: 1.25rem;
}
.c5 {
font-size: 1.25rem;
display: block;
margin-top: 1.25rem;
margin-bottom: 0.625rem;
}
.c3 {
font-size: 1.25rem;
display: block;
margin-top: 1.25rem;
margin-bottom: 0.625rem;
}
.c2 {
width: 100%;
}
.c6 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
margin-bottom: 1.25rem;
}
@media print {
.c0 {
max-width: 100%;
padding: 0;
}
}
<div>
<div
class="c0"
>
<h3>
Chimie
</h3>
<p>
Quel est votre échelon dans la convention collective ?
<br />
Vous pouvez le trouver sur votre bulletin de salaire
</p>
<label
class="c1"
for="echelon"
>
Sélectionnez un échelon
</label>
<select
class="c2"
id="echelon"
name="echelon"
>
<option
disabled=""
value=""
/>
<option
value="130"
>
130
</option>
<option
value="140"
>
140
</option>
<option
value="150"
>
150
</option>
<option
value="160"
>
160
</option>
<option
value="175"
>
175
</option>
<option
value="190"
>
190
</option>
<option
value="205"
>
205
</option>
<option
value="225"
>
225
</option>
<option
value="235"
>
235
</option>
<option
value="250"
>
250
</option>
<option
value="275"
>
275
</option>
<option
value="300"
>
300
</option>
<option
value="325"
>
325
</option>
<option
value="350"
>
350
</option>
<option
value="360"
>
360
</option>
<option
value="400"
>
400
</option>
<option
value="460"
>
460
</option>
<option
value="480"
>
480
</option>
<option
value="510"
>
510
</option>
<option
value="550"
>
550
</option>
<option
value="660"
>
660
</option>
<option
value="770"
>
770
</option>
<option
value="880"
>
880
</option>
</select>
<p
class="c3"
>
Est ce que votre entreprise est affiliée à une des organisations patronales employeur ?
</p>
<div
class="c4"
>
<label
class="c1"
>
<input
name="hasOpe"
type="radio"
value="true"
/>
<span>
Oui
</span>
</label>
<label
class="c1"
>
<input
name="hasOpe"
type="radio"
value="false"
/>
<span>
Non
</span>
</label>
</div>
<p
class="c3"
>
Le motif de votre licenciement est-il économique ?
</p>
<div
class="c4"
>
<label
class="c1"
>
<input
name="isEco"
type="radio"
value="true"
/>
<span>
Oui
</span>
</label>
<label
class="c1"
>
<input
name="isEco"
type="radio"
value="false"
/>
<span>
Non
</span>
</label>
</div>
<label
class="c5"
for="1"
>
Quel etait votre âge à la date du licenciement ?
</label>
<div
class="c6"
>
<input
class="c7"
id="1"
name="age"
type="number"
value=""
/>
</div>
</div>
</div>
`;

exports[`<Step_0044 /> should render 1`] = `
.c0 {
max-width: 1200px;
Expand Down

0 comments on commit 00ff373

Please sign in to comment.