Skip to content

Commit

Permalink
Fix test for requiered label
Browse files Browse the repository at this point in the history
Co-authored-by: Fael Bassetti <fael.bassetti@pix.fr>
Co-authored-by: Laura Bergoens <laura.bergoens@pix.fr>
  • Loading branch information
3 people authored Nov 22, 2024
1 parent a8c4d0a commit a065073
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions pix-editor/tests/acceptance/login-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module('Acceptance | Login', function(hooks) {
await visit('/');

// when
await fillByLabel('* Clé API', VALID_API_KEY);
await fillByLabel('Clé API *', VALID_API_KEY);
await clickByName('Se connecter');

// then
Expand All @@ -52,7 +52,7 @@ module('Acceptance | Login', function(hooks) {
await visit('/');

// when
await fillByLabel('* Clé API', INVALID_API_KEY);
await fillByLabel('Clé API *', INVALID_API_KEY);
await clickByName('Se connecter');

// then
Expand All @@ -65,7 +65,7 @@ module('Acceptance | Login', function(hooks) {
await visit('/statistics');

// when
await fillByLabel('* Clé API', VALID_API_KEY);
await fillByLabel('Clé API *', VALID_API_KEY);
await clickByName('Se connecter');

// then
Expand Down
4 changes: 2 additions & 2 deletions pix-editor/tests/acceptance/missions/creation-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ module('Acceptance | Missions | Creation', function(hooks) {
const screen = await visit('/missions/new');

// when
await fillByLabel('* Nom de la mission', 'Nouvelle mission de test');
await fillByLabel('Nom de la mission *', 'Nouvelle mission de test');
await triggerEvent(find('#mission-name'), 'keyup', '');

await fillByLabel('URL de l\'image de la carte', 'https://example.pix.fr/ma-image.png');
Expand All @@ -91,7 +91,7 @@ module('Acceptance | Missions | Creation', function(hooks) {
const screen = await visit('/missions/new');

// when
await fillByLabel('* Nom de la mission', 'Nouvelle mission de test');
await fillByLabel('Nom de la mission *', 'Nouvelle mission de test');
await triggerEvent(find('#mission-name'), 'keyup', '');
await clickByName('Annuler');

Expand Down
4 changes: 2 additions & 2 deletions pix-editor/tests/acceptance/missions/edit_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ module('Acceptance | Missions | Edit', function(hooks) {
const screen = await visit('/missions/3/edit');

// when
await fillByLabel('* Nom de la mission', 'Nouvelle mission de test');
await fillByLabel('Nom de la mission *', 'Nouvelle mission de test');
await triggerEvent(find('#mission-name'), 'keyup', '');

await fillByLabel('URL de l\'image de la carte', 'https://images.pix.fr/badges/Pix_Plus-Donnee-Visualisation_des_donnees.svg.svg');
Expand Down Expand Up @@ -101,7 +101,7 @@ module('Acceptance | Missions | Edit', function(hooks) {
const screen = await visit('/missions/3/edit');

// when
await fillByLabel('* Nom de la mission', 'will trigger error');
await fillByLabel('Nom de la mission *', 'will trigger error');
await triggerEvent(find('#mission-name'), 'keyup', '');

await clickByText('Compétence');
Expand Down
4 changes: 2 additions & 2 deletions pix-editor/tests/acceptance/static-courses/creation-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ module('Acceptance | Static Courses | Creation', function(hooks) {
await clickByName('Créer un nouveau test');

// when
await fillByLabel('* Nom du test statique', 'Mon nouveau test statique');
await fillByLabel('Nom du test statique *', 'Mon nouveau test statique');
await fillByLabel('Description à usage interne', 'Une super description pour mon nouveau test');
await fillByLabel('Tags', 'cou');
await clickByText('COUrage');
Expand Down Expand Up @@ -118,7 +118,7 @@ module('Acceptance | Static Courses | Creation', function(hooks) {
await clickByName('Créer un nouveau test');

// when
await fillByLabel('* Nom du test statique', 'Mon nouveau test statique');
await fillByLabel('Nom du test statique *', 'Mon nouveau test statique');
await fillByLabel('Description à usage interne', 'Une super description');
await fillByLabel('IDs des épreuves', 'chalA\nchalC');
await clickByName('Annuler');
Expand Down
4 changes: 2 additions & 2 deletions pix-editor/tests/integration/components/form/missions-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module('Integration | Component | mission', function(hooks) {
@submitButtonText={{this.submitButtonText}}
/>`);

await fillByLabel('* Nom de la mission', 'Nouvelle mission de test');
await fillByLabel('Nom de la mission *', 'Nouvelle mission de test');
await triggerEvent(find('#mission-name'), 'keyup', '');

await fillByLabel('URL de l\'image de la carte', 'https://images.pix.fr/badges/Pix_Plus-Donnee-Visualisation_des_donnees.svg.svg');
Expand All @@ -45,7 +45,7 @@ module('Integration | Component | mission', function(hooks) {
@submitButtonText={{this.submitButtonText}}
/>`);

await fillByLabel('* Nom de la mission', 'Nouvelle mission de test');
await fillByLabel('Nom de la mission *', 'Nouvelle mission de test');
await triggerEvent(find('#mission-name'), 'keyup', '');

const button = screen.getByRole('button', { name: 'Créer la mission' });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ module('Integration | Component | Form | whitelisted-url', function(hooks) {
const urlErrorMandatoryField = screen.getByText('L\'URL est obligatoire');
assert.dom(urlErrorMandatoryField).isVisible();

await fillByLabel('* URL à whitelister', 'chouchou beignets');
await fillByLabel('URL à whitelister *', 'chouchou beignets');
const urlErrorInvalidUrl = screen.getByText('L\'URL n\'est pas valide');
assert.dom(urlErrorInvalidUrl).isVisible();

await fillByLabel('* URL à whitelister', 'https://example.org');
await fillByLabel('URL à whitelister *', 'https://example.org');
assert.dom(urlErrorInvalidUrl).isNotVisible();
assert.dom(urlErrorMandatoryField).isNotVisible();

Expand Down

0 comments on commit a065073

Please sign in to comment.