Skip to content

Commit

Permalink
Affiche le champ nom du formulaire de login même quand il est forcé
Browse files Browse the repository at this point in the history
  • Loading branch information
etienneCharignon committed Jul 24, 2023
1 parent 35ded99 commit edb9c50
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
5 changes: 2 additions & 3 deletions src/situations/accueil/vues/formulaire_identification.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,17 @@
<div class="elements-formulaire">
<div>
<label
v-if="!nomForce"
for="formulaire-identification-champ-nom">
{{ $traduction('accueil.identification.label') }}
</label>
<div
class="element-formulaire"
v-if="!nomForce">
class="element-formulaire">
<input
id="formulaire-identification-champ-nom"
v-model.trim="nom"
type="text"
class="champ champ-texte champ-texte-accueil"
:disabled="nomForce"
autofocus>
<span
v-if="erreurFormulaireIdentification.nom"
Expand Down
10 changes: 6 additions & 4 deletions tests/situations/accueil/vues/formulaire_identification.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,15 +220,17 @@ describe("Le formulaire d'identification", function () {
expect(wrapper.vm.campagne).toEqual('ETE-2019');
expect(wrapper.findAll('label').length).toBe(3);
const champs = wrapper.findAll('.champ-texte-accueil');
expect(champs.at(1).attributes('disabled')).toBe('');
expect(champs.at(1).attributes('disabled')).not.toBeUndefined();
});

it('cache le champ nom/prénom si il y a une propriété forceNom', function () {
it('disable le champ nom/prénom si il y a une propriété forceNom', function () {
expect(wrapper.findAll('.champ-texte-accueil').length).toBe(2);
wrapper = composant({ forceNom: 'franck-poulain' });
expect(wrapper.vm.nom).toEqual('franck-poulain');
expect(wrapper.findAll('label').length).toBe(2);
expect(wrapper.findAll('.champ-texte-accueil').length).toBe(1);
expect(wrapper.findAll('label').length).toBe(3);
const champs = wrapper.findAll('.champ-texte-accueil');
expect(champs.length).toBe(2);
expect(champs.at(0).attributes('disabled')).not.toBeUndefined();
});

describe('#champCodeEstDesactive', function () {
Expand Down

0 comments on commit edb9c50

Please sign in to comment.