From 93600eae33ca732d3f97704301945772cd0bc0f4 Mon Sep 17 00:00:00 2001 From: Daniel Karski Date: Tue, 17 Sep 2024 10:30:32 +0200 Subject: [PATCH] [CP-3093] Add data-testid to Success modal for Contact Support Form sending (#2054) --- ...ontact-support-modal-success.component.tsx | 14 +++++++---- libs/e2e-test-ids/.eslintrc.json | 18 +++++++++++++++ libs/e2e-test-ids/README.md | 7 ++++++ libs/e2e-test-ids/project.json | 23 +++++++++++++++++++ libs/e2e-test-ids/src/e2e-test-ids.ts | 14 +++++++++++ libs/e2e-test-ids/src/index.ts | 6 +++++ libs/e2e-test-ids/tsconfig.json | 16 +++++++++++++ libs/e2e-test-ids/tsconfig.lib.json | 9 ++++++++ .../theme/src/lib/generic-theme-provider.tsx | 2 +- .../modal/helpers/modal-close-button.tsx | 9 ++++---- nx.json | 5 ++++ tsconfig.base.json | 1 + 12 files changed, 115 insertions(+), 9 deletions(-) create mode 100644 libs/e2e-test-ids/.eslintrc.json create mode 100644 libs/e2e-test-ids/README.md create mode 100644 libs/e2e-test-ids/project.json create mode 100644 libs/e2e-test-ids/src/e2e-test-ids.ts create mode 100644 libs/e2e-test-ids/src/index.ts create mode 100644 libs/e2e-test-ids/tsconfig.json create mode 100644 libs/e2e-test-ids/tsconfig.lib.json diff --git a/libs/core/contact-support/components/contact-support-modal-success.component.tsx b/libs/core/contact-support/components/contact-support-modal-success.component.tsx index f51cd23ee1..911630a3e1 100644 --- a/libs/core/contact-support/components/contact-support-modal-success.component.tsx +++ b/libs/core/contact-support/components/contact-support-modal-success.component.tsx @@ -5,11 +5,12 @@ import React from "react" import { defineMessages } from "react-intl" -import { FunctionComponent } from "Core/core/types/function-component.interface" +import { ContactSupportModalTestIds } from "e2e-test-ids" import { Modal } from "generic-view/ui" +import { IconType } from "generic-view/utils" +import { FunctionComponent } from "Core/core/types/function-component.interface" import { intl } from "Core/__deprecated__/renderer/utils/intl" import { ButtonSecondary } from "../../../generic-view/ui/src/lib/buttons/button-secondary" -import { IconType } from "generic-view/utils" const messages = defineMessages({ title: { id: "component.supportModalSuccessTitle" }, @@ -26,10 +27,15 @@ export const ContactSupportModalSuccess: FunctionComponent = ({ }) => ( <> - {intl.formatMessage(messages.title)} -

{intl.formatMessage(messages.body)}

+ + {intl.formatMessage(messages.title)} + +

+ {intl.formatMessage(messages.body)} +

` box-shadow: 0 2rem 10rem 0 ${({ theme }) => theme.color.black + "26"}; } - .modal-close-button:nth-child(2) { + .modal-close-icon-button:nth-child(2) { display: none; } * { diff --git a/libs/generic-view/ui/src/lib/interactive/modal/helpers/modal-close-button.tsx b/libs/generic-view/ui/src/lib/interactive/modal/helpers/modal-close-button.tsx index 3bd02fa7d7..590d9493df 100644 --- a/libs/generic-view/ui/src/lib/interactive/modal/helpers/modal-close-button.tsx +++ b/libs/generic-view/ui/src/lib/interactive/modal/helpers/modal-close-button.tsx @@ -5,24 +5,25 @@ import React from "react" import styled, { css } from "styled-components" +import { ModalCloseButtonTestIds } from "e2e-test-ids" import { APIFC, IconType } from "generic-view/utils" +import { ModalCloseButtonConfig } from "generic-view/models" import { ButtonBase } from "../../../buttons/button-base/button-base" import { iconButtonStyles } from "../../../shared/button" import { Icon } from "../../../icon/icon" -import { ModalCloseButtonConfig } from "generic-view/models" export const ModalCloseButton: APIFC = ({ data, config, - className, + className = "", ...rest }) => { if (!config?.action) return null return ( diff --git a/nx.json b/nx.json index 1ee96c524d..4267796381 100644 --- a/nx.json +++ b/nx.json @@ -39,5 +39,10 @@ } } } + }, + "pluginsConfig": { + "@nx/js": { + "analyzeSourceFiles": true + } } } diff --git a/tsconfig.base.json b/tsconfig.base.json index 8cb30bec95..1a11ab9e48 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -46,6 +46,7 @@ "e2e-mock-client": ["libs/e2e-mock/client/src/index.ts"], "e2e-mock-responses": ["libs/e2e-mock/responses/src/index.ts"], "e2e-mock-server": ["libs/e2e-mock/server/src/index.ts"], + "e2e-test-ids": ["libs/e2e-test-ids/src/index.ts"], "electron/application-updater": [ "libs/electron/application-updater/src/index.ts" ],