Skip to content

Commit

Permalink
feat(Bonus Pagamenti Digitali): [#177187748] Unlock the search for SI…
Browse files Browse the repository at this point in the history
…A and ICCREA (for test only) (#2862)

* [#177187748] unlock the search for SIA and ICCREA

* [#177187748] remove test

* [#177187748] fix test overlay

* [#177187748] remove track
  • Loading branch information
fabriziofff authored Mar 3, 2021
1 parent 862dfd9 commit 8f29540
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .env.production
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -48,18 +47,14 @@ 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 (
<CoBadgeChosenBankScreen
abi={props.maybeAbiSelected}
testID={"CoBadgeChosenBankScreenSingleBank"}
/>
);
case StatusEnum.disabled:
void trackOutput("Disabled", props.maybeAbiSelected);
// The chosen ABI is disabled (not yet available)
return <CoBadgeStartKoDisabled />;
case StatusEnum.unavailable:
void trackOutput("Unavailable", props.maybeAbiSelected);
// THe chosen ABI is unavailable (technical problems)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 8f29540

Please sign in to comment.