From 8f29540e987513d201c52333f31c195e45b73990 Mon Sep 17 00:00:00 2001 From: fabriziofff Date: Wed, 3 Mar 2021 18:44:00 +0100 Subject: [PATCH] feat(Bonus Pagamenti Digitali): [#177187748] Unlock the search for SIA and ICCREA (for test only) (#2862) * [#177187748] unlock the search for SIA and ICCREA * [#177187748] remove test * [#177187748] fix test overlay * [#177187748] remove track --- .env.production | 2 +- .../screens/start/CoBadgeStartScreen.tsx | 7 +--- .../__test__/CoBadgeStartScreen.test.tsx | 32 ------------------- 3 files changed, 2 insertions(+), 39 deletions(-) diff --git a/.env.production b/.env.production index 57ed9cc193d..7e44cec3458 100644 --- a/.env.production +++ b/.env.production @@ -43,7 +43,7 @@ MYPORTAL_ENABLED=NO PLAYGROUNDS_ENABLED=YES # BPD configuration BPD_ENABLED=YES -BPD_TEST_OVERLAY=NO +BPD_TEST_OVERLAY=YES PRIVATIVE_ENABLED=NO # endpoint BPD API BPD_API_URL_PREFIX=https://prod.cstar.pagopa.it diff --git a/ts/features/wallet/onboarding/cobadge/screens/start/CoBadgeStartScreen.tsx b/ts/features/wallet/onboarding/cobadge/screens/start/CoBadgeStartScreen.tsx index aab8de7986b..c7d8f18e32b 100644 --- a/ts/features/wallet/onboarding/cobadge/screens/start/CoBadgeStartScreen.tsx +++ b/ts/features/wallet/onboarding/cobadge/screens/start/CoBadgeStartScreen.tsx @@ -12,7 +12,6 @@ import { loadCoBadgeAbiConfiguration } from "../../store/actions"; import { getCoBadgeAbiConfigurationSelector } from "../../store/reducers/abiConfiguration"; import { onboardingCoBadgeAbiSelectedSelector } from "../../store/reducers/abiSelected"; import CoBadgeChosenBankScreen from "./CoBadgeChosenBankScreen"; -import CoBadgeStartKoDisabled from "./ko/CoBadgeStartKoDisabled"; import CoBadgeStartKoUnavailable from "./ko/CoBadgeStartKoUnavailable"; import LoadAbiConfiguration from "./LoadAbiConfiguration"; @@ -48,7 +47,7 @@ const CoBadgeStartComponent = (props: Props): React.ReactElement => { } switch (props.abiSelectedConfiguration.value) { case StatusEnum.enabled: - void trackOutput("Enabled", props.maybeAbiSelected); + case StatusEnum.disabled: // Single ABI (bank) screen that allow to start the search return ( { testID={"CoBadgeChosenBankScreenSingleBank"} /> ); - case StatusEnum.disabled: - void trackOutput("Disabled", props.maybeAbiSelected); - // The chosen ABI is disabled (not yet available) - return ; case StatusEnum.unavailable: void trackOutput("Unavailable", props.maybeAbiSelected); // THe chosen ABI is unavailable (technical problems) diff --git a/ts/features/wallet/onboarding/cobadge/screens/start/__test__/CoBadgeStartScreen.test.tsx b/ts/features/wallet/onboarding/cobadge/screens/start/__test__/CoBadgeStartScreen.test.tsx index ecd04a673f4..4c7e19d45d3 100644 --- a/ts/features/wallet/onboarding/cobadge/screens/start/__test__/CoBadgeStartScreen.test.tsx +++ b/ts/features/wallet/onboarding/cobadge/screens/start/__test__/CoBadgeStartScreen.test.tsx @@ -24,18 +24,6 @@ jest.mock("react-native-share", () => jest.fn()); const configurationFailure = getGenericError(new Error("generic Error")); const abiTestId = "9876"; const abiTestId2 = "2222"; -const abiConfigurationWithoutBankMock: CoBadgeServices = { - ServiceName: { - status: StatusEnum.enabled, - issuers: [{ abi: "1", name: "bankName" }] - } -}; -const abiConfigurationDisabled: CoBadgeServices = { - ServiceName: { - status: StatusEnum.disabled, - issuers: [{ abi: abiTestId, name: "bankName" }] - } -}; const abiConfigurationUnavailable: CoBadgeServices = { ServiceName: { status: StatusEnum.unavailable, @@ -156,24 +144,7 @@ describe("Test behaviour of the CoBadgeStartScreen", () => { ).toBeTruthy(); } }); - it("When receive a configuration without the selected abi, the screen should render CoBadgeStartKoDisabled", () => { - const { store, testComponent } = getInitCoBadgeStartScreen(abiTestId); - - store.dispatch( - loadCoBadgeAbiConfiguration.success(abiConfigurationWithoutBankMock) - ); - // The user should see the disabled screen when the selected abi is not in the remote configuration - expect(isDisabledScreen(testComponent)).toBe(true); - }); - it("When receive a configuration without an abi disabled, the screen should render CoBadgeStartKoDisabled", () => { - const { store, testComponent } = getInitCoBadgeStartScreen(abiTestId); - store.dispatch( - loadCoBadgeAbiConfiguration.success(abiConfigurationDisabled) - ); - // The user should see the disabled screen - expect(isDisabledScreen(testComponent)).toBe(true); - }); it("When receive a configuration with an abi unavailable, the screen should render CoBadgeStartKoUnavailable", () => { const { store, testComponent } = getInitCoBadgeStartScreen(abiTestId); @@ -265,9 +236,6 @@ const isAllBankScreen = (component: RenderAPI) => const isLoadingScreen = (component: RenderAPI) => component.queryByTestId("LoadAbiConfiguration") !== null; -const isDisabledScreen = (component: RenderAPI) => - component.queryByTestId("CoBadgeStartKoDisabled") !== null; - const isUnavailableScreen = (component: RenderAPI) => component.queryByTestId("CoBadgeStartKoUnavailable") !== null;