Skip to content

Commit

Permalink
Merge branch 'master' into IOCOM-1830-app-test-automatici-fims-histor…
Browse files Browse the repository at this point in the history
…y-non-empty-content
  • Loading branch information
forrest57 authored Feb 14, 2025
2 parents 6188335 + 84a1f99 commit 9be76ae
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,17 @@ const CgnDiscountDetailScreen = () => {
}
};

const { backgroundColor } = discountDetails?.isNew
? styles.backgroundNewItem
: styles.backgroundDefault;

useHeaderSecondLevel({
title: discountDetails?.name || "",
scrollValues: {
contentOffsetY: translationY,
triggerOffset: titleHeight
},
transparent: true,
backgroundColor,
canGoBack: true,
supportRequest: true
});
Expand Down Expand Up @@ -249,10 +253,6 @@ const CgnDiscountDetailScreen = () => {
);
};

const discountColor = discountDetails?.isNew
? styles.backgroundNewItem
: styles.backgroundDefault;

if (discountDetails && merchantDetails) {
return (
<>
Expand All @@ -272,7 +272,7 @@ const CgnDiscountDetailScreen = () => {
style={{
position: "absolute",
height: 1000,
backgroundColor: discountColor.backgroundColor,
backgroundColor,
top: -1000,
right: 0,
left: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ const CgnMerchantsListByCategory = () => {
contentOffsetY: translationY,
triggerOffset: titleHeight
},
transparent: true,
backgroundColor: categorySpecs?.colors,
supportRequest: true,
secondAction: {
icon: "search",
Expand Down Expand Up @@ -195,14 +195,12 @@ const CgnMerchantsListByCategory = () => {
style={[
IOStyles.horizontalContentPadding,
{
paddingTop: insets.top,
backgroundColor: categorySpecs.colors,
paddingBottom: 24
}
]}
>
<VSpacer size={48} />
<VSpacer size={32} />
<VSpacer size={24} />
<View style={[IOStyles.row, { alignItems: "center" }]}>
<View
style={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ const MissingConfigurationAlert = (props: Props) => {
<>
<Alert
ref={viewRef}
testID="missing-configuration-alert"
content={I18n.t(
`idpay.initiative.details.initiativeDetailsScreen.configured.errorAlerts.${status}.content`
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,6 @@ const IdPayInitiativeDetailsScreen = () => {
case InitiativeRewardTypeEnum.EXPENSE:
return (
<ContentWrapper>
<MissingConfigurationAlert
initiativeId={initiativeId}
status={initiative.status}
/>
<VSpacer size={8} />
<InitiativeTimelineComponent
initiativeId={initiativeId}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,32 @@ describe("Test IdPayInitiativeDetailsScreen screen", () => {
)
).toBeTruthy();
});

it("should not render the banner missing configuration Alert for EXPENSE initiatives that have status not undefined", () => {
const { component } = renderComponent(
pot.some({
...mockedInitiative,
initiativeRewardType: InitiativeRewardTypeEnum.EXPENSE,
status: StatusEnum.NOT_REFUNDABLE_ONLY_IBAN
})
);
expect(component).toBeTruthy();
expect(component).not.toBeNull();
expect(component.queryByTestId("missing-configuration-alert")).toBeNull();
});

it("should render the banner missing configuration Alert for REFUND initiatives with status not undefined", () => {
const { component } = renderComponent(
pot.some({
...mockedInitiative,
initiativeRewardType: InitiativeRewardTypeEnum.REFUND,
status: StatusEnum.NOT_REFUNDABLE_ONLY_IBAN
})
);
expect(component).toBeTruthy();
expect(component).not.toBeNull();
expect(component.getByTestId("missing-configuration-alert")).toBeTruthy();
});
});

const renderComponent = (
Expand Down

0 comments on commit 9be76ae

Please sign in to comment.