Skip to content

Commit

Permalink
added notification tab in admin + fixed cypress tests to target notif…
Browse files Browse the repository at this point in the history
…ications tab
  • Loading branch information
enguerranws committed Jun 13, 2023
1 parent fb0f7b3 commit 5765cd7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
1 change: 1 addition & 0 deletions cypress/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export default defineConfig({
// Temp fix, Cypress seems to report elements as disabled when they are not https://github.com/cypress-io/cypress/issues/5827
force: true,
},
timeForEventCrawler: 10000,
},
},
e2e: {
Expand Down
2 changes: 1 addition & 1 deletion cypress/cypress/support/admin/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Cypress.Commands.add("connectToAdmin", () => {
});

Cypress.Commands.add("openEmailInAdmin", ({ emailType, elementIndex = 0 }) => {
cy.get(".fr-tabs__tab").contains("Emails").click();
cy.get(".fr-tabs__tab").contains("Notifications").click();
const accordionButton = cy
.get(`.fr-accordion__btn:contains(${emailType})`)
.eq(elementIndex);
Expand Down
8 changes: 3 additions & 5 deletions cypress/e2e/conventionWorkflow.spec.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import {
import { disableUrlLogging } from "../cypress/utils/log";
import { addBusinessDays, format } from "date-fns";

const { baseApiRoute } = Cypress.env("config");
const { baseApiRoute, defaultFieldOptions, timeForEventCrawler } =
Cypress.env("config");
const selectedAgencyId = "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa";
const timeForEventCrawler = 20000;

describe("Convention full workflow", () => {
const conventionData = {
Expand Down Expand Up @@ -63,9 +63,7 @@ describe("Convention full workflow", () => {
);
cy.get(
`#draft-modal #${domElementIds.manageConvention.justificationModalSubmitButton}`,
).click({
force: true,
});
).click(defaultFieldOptions);
cy.wait("@updateConventionRequest")
.its("response.statusCode")
.should("eq", 200);
Expand Down
2 changes: 1 addition & 1 deletion front/src/app/pages/admin/AdminPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const AdminPage = ({
<div className={fr.cx("fr-col-12", "fr-p-2w", "fr-mt-4w")}>
<Tabs
selectedTabId={currentTab}
tabs={adminTabs.filter((tab) => tab.tabId !== "notifications")}
tabs={adminTabs}
onTabChange={(tab) => {
if (isAdminTab(tab))
routes
Expand Down

0 comments on commit 5765cd7

Please sign in to comment.