Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnaud AMBROSELLI committed Sep 7, 2023
1 parent a387e13 commit e7cee7e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dashboard/src/scenes/search/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ const observationsBySearchSelector = selectorFamily({
const populatedObservations = get(populatedObservationsSelector);
const observations = get(onlyFilledObservationsTerritories);
if (!search?.length) return [];
const observationsFilteredBySearch = filterBySearch(search, observations, true);
const observationsFilteredBySearch = filterBySearch(search, observations);
return observationsFilteredBySearch.map((obs) => populatedObservations[obs._id]).filter(Boolean);
},
});
Expand Down
2 changes: 0 additions & 2 deletions dashboard/src/scenes/search/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ export const filterBySearch = (search, items = [], userSpecificExcludeFields = [
const anyOtherPrropertyContainsOneOfTheWords = [];
const anyOtherPrropertyContainsOneOfTheWordsWithNoAccent = [];

console.log({ userSpecificExcludeFields });

for (const item of items) {
const lowerCaseName = item?.name?.toLocaleLowerCase() || '';
if (lowerCaseName.startsWith(searchLowercased)) {
Expand Down
6 changes: 3 additions & 3 deletions e2e/global_restricted-roles.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,9 @@ test("test restricted accesses", async ({ page }) => {
await expect(page.getByRole("list").getByText("Rencontres")).toBeVisible();
await expect(page.getByRole("list").getByText("Observations")).toBeVisible();
await expect(page.getByRole("list").getByText("Comptes-rendus")).toBeVisible();
await expect(page.getByRole("list").getByText("Consultations")).not.toBeVisible();
await expect(page.getByRole("list").getByText("Dossiers médicaux des personnes suivies", { exact: true })).not.toBeVisible();
await expect(page.getByRole("list").getByText("Dossiers médicaux des personnes créées", { exact: true })).not.toBeVisible();
await expect(page.getByRole("list").getByText("Consultations")).toBeVisible();
await expect(page.getByRole("list").getByText("Dossiers médicaux des personnes suivies", { exact: true })).toBeVisible();
await expect(page.getByRole("list").getByText("Dossiers médicaux des personnes créées", { exact: true })).toBeVisible();

await expect(page.getByRole("link", { name: "Organisation" })).not.toBeVisible();
await expect(page.getByRole("link", { name: "Équipes" })).not.toBeVisible();
Expand Down

0 comments on commit e7cee7e

Please sign in to comment.