diff --git a/admin/app/components/common/tubes-details/area.gjs b/admin/app/components/common/tubes-details/area.gjs
index a2b7a72004f..d8684d9844b 100644
--- a/admin/app/components/common/tubes-details/area.gjs
+++ b/admin/app/components/common/tubes-details/area.gjs
@@ -1,11 +1,11 @@
-import PixAccordions from '@1024pix/pix-ui/components/pix-accordions';
+import PixCollapsible from '@1024pix/pix-ui/components/pix-collapsible';
import Competence from '../tubes-details/competence';
-
+
<:title>{{@title}}
<:content>
{{#each @competences as |competence|}}
@@ -17,6 +17,6 @@ import Competence from '../tubes-details/competence';
/>
{{/each}}
-
+
diff --git a/admin/app/components/common/tubes-details/competence.gjs b/admin/app/components/common/tubes-details/competence.gjs
index e6c285db768..e47389f6cec 100644
--- a/admin/app/components/common/tubes-details/competence.gjs
+++ b/admin/app/components/common/tubes-details/competence.gjs
@@ -1,4 +1,4 @@
-import PixAccordions from '@1024pix/pix-ui/components/pix-accordions';
+import PixCollapsible from '@1024pix/pix-ui/components/pix-collapsible';
import { eq } from 'ember-truth-helpers';
import Header from '../../table/header';
@@ -7,7 +7,7 @@ import Tube from '../tubes-details/tube';
-
+
<:title>{{@title}}
<:content>
@@ -56,6 +56,6 @@ import Tube from '../tubes-details/tube';
-
+
diff --git a/admin/app/components/common/tubes-selection/areas.gjs b/admin/app/components/common/tubes-selection/areas.gjs
index b353da0deb1..a61bd18bc51 100644
--- a/admin/app/components/common/tubes-selection/areas.gjs
+++ b/admin/app/components/common/tubes-selection/areas.gjs
@@ -1,4 +1,4 @@
-import PixAccordions from '@1024pix/pix-ui/components/pix-accordions';
+import PixCollapsible from '@1024pix/pix-ui/components/pix-collapsible';
import Competence from './competence';
@@ -6,7 +6,7 @@ import Competence from './competence';
{{#each @areas as |area|}}
-
+
<:title>{{area.code}} · {{area.title}}
<:content>
{{#each area.sortedCompetences as |competence|}}
@@ -22,7 +22,7 @@ import Competence from './competence';
/>
{{/each}}
-
+
{{/each}}
diff --git a/admin/app/components/common/tubes-selection/competence.gjs b/admin/app/components/common/tubes-selection/competence.gjs
index a5d7413afee..18070c5e516 100644
--- a/admin/app/components/common/tubes-selection/competence.gjs
+++ b/admin/app/components/common/tubes-selection/competence.gjs
@@ -1,5 +1,5 @@
import PixCheckbox from '@1024pix/pix-ui/components/pix-checkbox';
-import PixAccordions from '@1024pix/pix-ui/components/pix-accordions';
+import PixCollapsible from '@1024pix/pix-ui/components/pix-collapsible';
import { on } from '@ember/modifier';
import { action } from '@ember/object';
import Component from '@glimmer/component';
@@ -47,7 +47,7 @@ export default class Competence extends Component {
-
+
<:title>{{@competence.index}} {{@competence.name}}
<:content>
@@ -110,7 +110,7 @@ export default class Competence extends Component {
-
+
}
diff --git a/certif/app/components/import/step-two-section.hbs b/certif/app/components/import/step-two-section.hbs
index f0419eb733d..d43cdbf847e 100644
--- a/certif/app/components/import/step-two-section.hbs
+++ b/certif/app/components/import/step-two-section.hbs
@@ -33,7 +33,7 @@
{{t "pages.sessions.import.step-two.blocking-errors.information"}}
{{/if}}
{{#if (gt this.nonBlockingErrorReportsCount 0)}}
@@ -74,7 +74,7 @@
}}
{{/if}}
diff --git a/high-level-tests/e2e/cypress/support/step_definitions/login-logout.js b/high-level-tests/e2e/cypress/support/step_definitions/login-logout.js
index 3c2d80d987c..0fd01e3e7fe 100644
--- a/high-level-tests/e2e/cypress/support/step_definitions/login-logout.js
+++ b/high-level-tests/e2e/cypress/support/step_definitions/login-logout.js
@@ -85,7 +85,6 @@ When(`je me déconnecte`, () => {
});
When(`je me déconnecte de Pix Orga`, () => {
- cy.get('[aria-label="Ouvrir le menu utilisateur"]').click();
cy.contains("Se déconnecter").click();
});
diff --git a/mon-pix/app/components/user-tutorials/filters/sidebar.hbs b/mon-pix/app/components/user-tutorials/filters/sidebar.hbs
index 2fdc14493c1..542c174d0a9 100644
--- a/mon-pix/app/components/user-tutorials/filters/sidebar.hbs
+++ b/mon-pix/app/components/user-tutorials/filters/sidebar.hbs
@@ -8,7 +8,7 @@
{{#each this.sortedAreas as |area|}}
-
+
<:title>{{area.title}}
<:content>
@@ -22,7 +22,7 @@
{{/each}}
-
+
{{/each}}
diff --git a/orga/app/components/layout/organization-places-or-credit-info.gjs b/orga/app/components/layout/organization-places-or-credit-info.gjs
index 1ef474221d4..236d6c26980 100644
--- a/orga/app/components/layout/organization-places-or-credit-info.gjs
+++ b/orga/app/components/layout/organization-places-or-credit-info.gjs
@@ -1,6 +1,5 @@
import PixIcon from '@1024pix/pix-ui/components/pix-icon';
import PixTooltip from '@1024pix/pix-ui/components/pix-tooltip';
-import { LinkTo } from '@ember/routing';
import { service } from '@ember/service';
import Component from '@glimmer/component';
import { t } from 'ember-intl';
diff --git a/orga/app/components/layout/user-logged-menu.hbs b/orga/app/components/layout/user-logged-menu.hbs
index 540bd683d75..766c73faaf5 100644
--- a/orga/app/components/layout/user-logged-menu.hbs
+++ b/orga/app/components/layout/user-logged-menu.hbs
@@ -1,31 +1,3 @@
-{{!--
-
- --}}
{{this.currentUser.prescriber.firstName}}
@@ -40,6 +12,4 @@
@label={{t "navigation.user-logged-menu.button"}}
@onChange={{this.onOrganizationChange}}
/>
-{{log this.eligibleOrganizations}}
-{{log this.currentUser.organization.id}}
{{t "navigation.user-logged-menu.logout"}}
\ No newline at end of file
diff --git a/orga/app/components/layout/user-logged-menu.js b/orga/app/components/layout/user-logged-menu.js
index 644b95934ac..7148410d8ce 100644
--- a/orga/app/components/layout/user-logged-menu.js
+++ b/orga/app/components/layout/user-logged-menu.js
@@ -20,7 +20,6 @@ export default class UserLoggedMenu extends Component {
if (!memberships) {
return [];
}
- console.log(this.currentUser.organization.id);
return memberships
.slice()
.map((membership) => ({
diff --git a/orga/app/templates/authenticated.hbs b/orga/app/templates/authenticated.hbs
index 6eb3be392a5..6403d357fe7 100644
--- a/orga/app/templates/authenticated.hbs
+++ b/orga/app/templates/authenticated.hbs
@@ -1,10 +1,5 @@
- {{! }}
- {{!
- TODO: remove component and merge tests
-
- }}
@@ -12,6 +7,5 @@
- {{!
}}
\ No newline at end of file
diff --git a/orga/tests/acceptance/authentication-test.js b/orga/tests/acceptance/authentication-test.js
index 86c4ecffc70..89f1266aa2c 100644
--- a/orga/tests/acceptance/authentication-test.js
+++ b/orga/tests/acceptance/authentication-test.js
@@ -1,5 +1,5 @@
import { clickByName, fillByLabel, visit } from '@1024pix/ember-testing-library';
-import { currentURL } from '@ember/test-helpers';
+import { click, currentURL } from '@ember/test-helpers';
import setupMirage from 'ember-cli-mirage/test-support/setup-mirage';
import { t } from 'ember-intl/test-support';
import { setupApplicationTest } from 'ember-qunit';
@@ -277,7 +277,8 @@ module('Acceptance | authentication', function (hooks) {
test('should display session status', async function (assert) {
const now = new Date(2024, 5, 12, 14);
const sessionExpirationDate = new Date(2024, 5, 12, 16);
- clock = sinon.useFakeTimers({ now, toFake: ['Date'] });
+ console.log(now);
+ clock = sinon.useFakeTimers({ now, shouldAdvanceTime: true, toFake: ['Date'] });
const user = createPrescriberForOrganization(
{ lang: 'fr', pixOrgaTermsOfServiceAccepted: true },
{
@@ -298,8 +299,9 @@ module('Acceptance | authentication', function (hooks) {
});
test('should handle starting session', async function (assert) {
- const now = new Date(2024, 5, 12, 14);
- clock = sinon.useFakeTimers({ now, toFake: ['Date'] });
+ const now = Date.parse(new Date(2024, 5, 12, 14));
+ console.log(now);
+ clock = sinon.useFakeTimers({ now, shouldAdvanceTime: true, toFake: ['Date'] });
const user = createPrescriberForOrganization(
{ lang: 'fr', pixOrgaTermsOfServiceAccepted: true },
{
@@ -313,8 +315,10 @@ module('Acceptance | authentication', function (hooks) {
);
await authenticateSession(user.id);
const screen = await visit('/');
- await clickByName(t('navigation.school-sessions.activate-button'));
-
+ const activateButton = await screen.findByRole('button', {
+ name: t('navigation.school-sessions.activate-button'),
+ });
+ await click(activateButton);
assert.ok(
screen.getByText(t('navigation.school-sessions.status.active-label', { sessionExpirationDate: '18:00' })),
);
diff --git a/orga/tests/acceptance/campaign-creation-test.js b/orga/tests/acceptance/campaign-creation-test.js
index 8d67b778aac..ee226246791 100644
--- a/orga/tests/acceptance/campaign-creation-test.js
+++ b/orga/tests/acceptance/campaign-creation-test.js
@@ -1,5 +1,5 @@
import { clickByName, fillByLabel, visit, within } from '@1024pix/ember-testing-library';
-import { click, currentURL, pauseTest } from '@ember/test-helpers';
+import { click, currentURL } from '@ember/test-helpers';
import setupMirage from 'ember-cli-mirage/test-support/setup-mirage';
import { t } from 'ember-intl/test-support';
import { setupApplicationTest } from 'ember-qunit';
diff --git a/orga/tests/acceptance/switch-organization-test.js b/orga/tests/acceptance/switch-organization-test.js
index a7989fe16ec..49bf988848e 100644
--- a/orga/tests/acceptance/switch-organization-test.js
+++ b/orga/tests/acceptance/switch-organization-test.js
@@ -1,4 +1,4 @@
-import { clickByName, visit } from '@1024pix/ember-testing-library';
+import { visit } from '@1024pix/ember-testing-library';
import { click } from '@ember/test-helpers';
import { currentURL } from '@ember/test-helpers';
import setupMirage from 'ember-cli-mirage/test-support/setup-mirage';
@@ -43,14 +43,13 @@ module('Acceptance | Switch Organization', function (hooks) {
test('should have an organization in menu', async function (assert) {
// when
- await visit('/');
- await clickByName("Changer d'organisation");
-
+ const screen = await visit('/');
+ const button = screen.getByRole('button', { name: "Changer d'organisation" });
+ await click(button);
// then
- assert.dom('.pix-select_list > li').exists({ count: 3 });
- assert
- .dom('.pix-select_list > li:not(.pix-select-list-category__option--hidden)')
- .hasText('BRO & Evil Associates');
+ const listbox = await screen.findAllByRole('option');
+ assert.strictEqual(listbox.length, 2);
+ assert.ok(await screen.findByRole('option', { name: 'BRO & Evil Associates' }));
});
module('When prescriber click on an organization', function () {
@@ -58,27 +57,30 @@ module('Acceptance | Switch Organization', function (hooks) {
// when
const screen = await visit('/');
- await clickByName("Changer d'organisation");
- await click(screen.getByText('My Heaven Company'));
+ const button = screen.getByRole('button', { name: "Changer d'organisation" });
+ await click(button);
+ const organizationSelected = await screen.findByRole('option', { name: 'My Heaven Company' });
+ await click(organizationSelected);
- //TODO: rendre plus précis ?
// then
- assert.ok(screen.getByText('My Heaven Company (HEAVEN)'));
+ assert.ok(organizationSelected);
});
test('should have the old main organization in the menu after switching', async function (assert) {
// when
const screen = await visit('/');
- await clickByName("Changer d'organisation");
+ const button = screen.getByRole('button', { name: "Changer d'organisation" });
+ await click(button);
+
+ const oldOrganization = await screen.findByRole('option', { name: 'My Heaven Company' });
await click(screen.getByText('My Heaven Company'));
- await clickByName("Changer d'organisation");
+ await click(button);
+ const listbox = await screen.findAllByRole('option');
- // then
- assert.dom('.pix-select_list > li').exists({ count: 3 });
- assert
- .dom('.pix-select_list > li:not(.pix-select-list-category__option--hidden):last-of-type')
- .hasText('My Heaven Company');
+ //then
+ assert.strictEqual(listbox.length, 2);
+ assert.ok(oldOrganization);
});
module('When prescriber is on campaign page with pagination', function () {
@@ -87,8 +89,10 @@ module('Acceptance | Switch Organization', function (hooks) {
const screen = await visit('/campagnes/les-miennes?pageNumber=2&pageSize=10&name=test&status=archived');
// when
- await clickByName("Changer d'organisation");
- await click(screen.getByText('My Heaven Company'));
+ const button = screen.getByRole('button', { name: "Changer d'organisation" });
+ await click(button);
+ const oldOrganization = await screen.findByRole('option', { name: 'My Heaven Company' });
+ await click(oldOrganization);
// then
assert.strictEqual(currentURL(), '/campagnes/les-miennes');
@@ -102,7 +106,8 @@ module('Acceptance | Switch Organization', function (hooks) {
// when
const screen = await visit('/');
- await clickByName("Changer d'organisation");
+ const button = screen.getByRole('button', { name: "Changer d'organisation" });
+ await click(button);
await click(screen.getByText('My Heaven Company'));
// then