Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
f963ccc
chore(OperationResultScreenContent): clean code and add fullWidth pro…
ChrisMattew Sep 26, 2025
97a9fa5
feat: add SendEngagementOnFirstAppOpenScreen
ChrisMattew Sep 26, 2025
71bff01
feat: add loginEngagement store
ChrisMattew Sep 26, 2025
1cc4f4d
Merge branch 'master' into IOCOM-2595-new-send-engagement-screen
ChrisMattew Sep 26, 2025
f940102
fix: fix typo in persistedPnLoginEngagementReducer whitelist persistC…
ChrisMattew Sep 26, 2025
705239a
Merge branch 'master' into IOCOM-2595-new-send-engagement-screen
ChrisMattew Oct 2, 2025
8b032c0
feat: add send activation happy path flow and refine navigation handl…
ChrisMattew Oct 3, 2025
bd9821f
chore: update tests accordingly with the changes made in the Operatio…
ChrisMattew Oct 3, 2025
90b3f27
chore: update tests for the custom hooks used in the send engagement …
ChrisMattew Oct 3, 2025
551bb80
feat: add Send activation error screen
ChrisMattew Oct 3, 2025
50486bd
feat(SendEngagementOnFirstAppOpenScreen): add useAvoidHardwareBackButton
ChrisMattew Oct 3, 2025
1eb0634
feat: add right tos and privacy send urls
ChrisMattew Oct 3, 2025
bf386c4
Merge remote-tracking branch 'origin/master' into IOCOM-2595-new-send…
ChrisMattew Oct 3, 2025
67a19d2
chore: update copy
ChrisMattew Oct 3, 2025
ba25b80
Merge branch 'master' into IOCOM-2595-new-send-engagement-screen
ChrisMattew Oct 6, 2025
5c83a09
Merge branch 'master' into IOCOM-2595-new-send-engagement-screen
ChrisMattew Oct 6, 2025
19e3f9d
Revert "chore: update tests accordingly with the changes made in the …
ChrisMattew Oct 6, 2025
113e628
Revert "chore(OperationResultScreenContent): clean code and add fullW…
ChrisMattew Oct 6, 2025
d4c0a0a
refactor(SendEngagementOnFirstAppOpenScreen): remove fullWidth from a…
ChrisMattew Oct 6, 2025
a0f679c
feat: add WhatsNewScreenContent component
ChrisMattew Oct 6, 2025
3c6fecb
refactor(SendEngagementOnFirstAppOpenScreen): replace OperationResult…
ChrisMattew Oct 6, 2025
33f28d5
Merge branch 'master' into IOCOM-2595-new-send-engagement-screen
ChrisMattew Oct 6, 2025
1dad29f
Merge branch 'master' into IOCOM-2595-new-send-engagement-screen
ChrisMattew Oct 7, 2025
fded214
Merge branch 'master' into IOCOM-2595-new-send-engagement-screen
ChrisMattew Oct 8, 2025
2e31c36
Merge branch 'master' into IOCOM-2595-new-send-engagement-screen
ChrisMattew Oct 8, 2025
bdad102
Merge branch 'master' into IOCOM-2595-new-send-engagement-screen
ChrisMattew Oct 8, 2025
872af6f
Merge branch 'master' into IOCOM-2595-new-send-engagement-screen
ChrisMattew Oct 9, 2025
0dc401a
Merge branch 'master' into IOCOM-2595-new-send-engagement-screen
ChrisMattew Oct 10, 2025
6423080
Merge branch 'master' into IOCOM-2595-new-send-engagement-screen
ChrisMattew Oct 10, 2025
90cc7e5
Merge branch 'master' into IOCOM-2595-new-send-engagement-screen
ChrisMattew Oct 10, 2025
2e9e2bf
Merge branch 'master' into IOCOM-2595-new-send-engagement-screen
ChrisMattew Oct 10, 2025
e7a26d3
Merge branch 'master' into IOCOM-2595-new-send-engagement-screen
ChrisMattew Oct 13, 2025
75039ee
Merge branch 'master' into IOCOM-2595-new-send-engagement-screen
ChrisMattew Oct 13, 2025
0967a91
refactor: abstract PushNotificationEngagementScreen
ChrisMattew Oct 13, 2025
ea0ca1d
Merge branch 'master' into IOCOM-2595-new-send-engagement-screen
ChrisMattew Oct 14, 2025
634f034
Merge branch 'master' into IOCOM-2595-new-send-engagement-screen
Vangaorth Oct 14, 2025
a176d89
feat: add navigation to PushNotificationEngagementScreen on SEND acti…
ChrisMattew Oct 14, 2025
2b39c11
Merge branch 'master' into IOCOM-2670-new-push-notification-engagemen…
ChrisMattew Oct 15, 2025
47b8dab
Merge branch 'master' into IOCOM-2595-new-send-engagement-screen
ChrisMattew Oct 15, 2025
b68adac
Merge branch 'master' into IOCOM-2670-new-push-notification-engagemen…
ChrisMattew Oct 15, 2025
2fd4f0b
Merge branch 'master' into IOCOM-2595-new-send-engagement-screen
ChrisMattew Oct 15, 2025
650d3df
docs(checkShouldDisplaySendEngagementScreen): add comment about the r…
ChrisMattew Oct 15, 2025
378e6ef
chore: rename pn prefix in send and remove whitelist from the persist…
ChrisMattew Oct 15, 2025
797f828
refactor(checkShouldDisplaySendEngagementScreen): remove shadowing an…
ChrisMattew Oct 15, 2025
191b32f
style: rename i18next occurences in i18n
ChrisMattew Oct 15, 2025
53881a9
chore(pnNavigator): remove gestureEnabled from screen options because…
ChrisMattew Oct 15, 2025
7c61b8a
refactor: remove setSendEngagementScreenHasBeenDismissed case from th…
ChrisMattew Oct 15, 2025
748eaed
refactor: replace navigation.navigate with navigation.replace and upd…
ChrisMattew Oct 15, 2025
107e9c3
Merge remote-tracking branch 'origin/master' into IOCOM-2595-new-send…
ChrisMattew Oct 15, 2025
acfc8ff
Merge branch 'IOCOM-2595-new-send-engagement-screen' into IOCOM-2670-…
ChrisMattew Oct 15, 2025
6efd7d6
chore: locales minor fix
ChrisMattew Oct 15, 2025
a9f9e19
Merge branch 'IOCOM-2595-new-send-engagement-screen' into IOCOM-2670-…
ChrisMattew Oct 15, 2025
847d89b
feat(useSendActivationFlow): add "access" flow value
ChrisMattew Oct 15, 2025
f8286ef
chore: update snapshots
ChrisMattew Oct 15, 2025
ad27f2b
Merge branch 'IOCOM-2595-new-send-engagement-screen' into IOCOM-2670-…
ChrisMattew Oct 15, 2025
19720d1
Merge branch 'master' into IOCOM-2595-new-send-engagement-screen
ChrisMattew Oct 16, 2025
5233121
Merge branch 'master' into IOCOM-2670-new-push-notification-engagemen…
ChrisMattew Oct 16, 2025
8e72862
chore: rename PNLoginEngagementActions in SENDLoginEngagementActions
ChrisMattew Oct 16, 2025
07e6663
feat(SendActivationErrorScreen): use replace instead of navigate
ChrisMattew Oct 16, 2025
9905dec
style: replace pn prefix with send prefix
ChrisMattew Oct 16, 2025
d551d5d
refactor(handleNavigateToSendEngagementScreen): improve code readability
ChrisMattew Oct 16, 2025
b82fa21
Merge branch 'IOCOM-2595-new-send-engagement-screen' into IOCOM-2670-…
ChrisMattew Oct 16, 2025
d250b03
Merge branch 'master' into IOCOM-2670-new-push-notification-engagemen…
ChrisMattew Oct 16, 2025
e1a2bfa
Merge branch 'master' into IOCOM-2670-new-push-notification-engagemen…
ChrisMattew Oct 16, 2025
e1fa7aa
Merge branch 'master' into IOCOM-2670-new-push-notification-engagemen…
ChrisMattew Oct 16, 2025
ecc485a
Merge branch 'master' into IOCOM-2670-new-push-notification-engagemen…
ChrisMattew Oct 16, 2025
9362aaa
Merge remote-tracking branch 'origin/master' into IOCOM-2670-new-push…
ChrisMattew Oct 16, 2025
979f9ab
Merge branch 'master' into IOCOM-2670-new-push-notification-engagemen…
Vangaorth Oct 17, 2025
e227a26
Merge branch 'master' into IOCOM-2670-new-push-notification-engagemen…
Vangaorth Oct 17, 2025
8279480
chore(SendQRScanFlowHandlerComponent): improve tests
ChrisMattew Oct 17, 2025
59c3677
refactor(PushNotificatonEngagementScreen): retrieve route params from…
ChrisMattew Oct 17, 2025
644eb4c
chore: remove unnecessary mock
ChrisMattew Oct 17, 2025
76174e6
chore(useSendActivationFlow): execute actions dispatch before checkin…
ChrisMattew Oct 17, 2025
1a0c5cd
fix: remove duplicated screens
ChrisMattew Oct 17, 2025
2688674
refactor(usePushNotificationEngagement): replace IOToast from appStat…
ChrisMattew Oct 17, 2025
ad05e27
Merge branch 'master' into IOCOM-2670-new-push-notification-engagemen…
ChrisMattew Oct 17, 2025
f288ea9
QRCODE_SCAN_SUCCESS, PUSH_NOTIF_APP_MODAL
Vangaorth Oct 19, 2025
192ebf0
PUSH_NOTIF_APP_MODAL_INTERACTION
Vangaorth Oct 19, 2025
67b6a9d
SEND_ACTIVATION_MODAL_DIALOG
Vangaorth Oct 19, 2025
8399e25
SEND_ACTIVATION_MODAL_DIALOG_ACTIVATION_START
Vangaorth Oct 19, 2025
91ebf65
SEND_ACTIVATION_MODAL_DIALOG_DISMISSED
Vangaorth Oct 19, 2025
a64b14f
SEND_TEMPORARY_NOTIFICATION_OPENING_DISCLAIMER
Vangaorth Oct 19, 2025
bb17ee6
SEND_TEMPORARY_NOTIFICATION_OPENING_DISCLAIMER_ACCEPTED
Vangaorth Oct 19, 2025
98a3d8c
SEND_TEMPORARY_NOTIFICATION_OPENING_DISCLAIMER_DISMISSED
Vangaorth Oct 19, 2025
a0416e4
SEND_TEMPORARY_NOTIFICATION_OPENING_NOT_ALLOWED
Vangaorth Oct 19, 2025
8e4301b
SEND_TEMPORARY_NOTIFICATION_OPENING_NOT_ALLOWED_MANDATE_INFO
Vangaorth Oct 19, 2025
bdcbc56
SEND_TEMPORARY_NOTIFICATION_OPENING_NOT_ALLOWED_DISMISSED
Vangaorth Oct 19, 2025
ebfbfbf
PN_UX_SUCCESS
Vangaorth Oct 19, 2025
89e6097
Merge branch 'master' into IOCOM-2586_aarPhase2Tracking
Vangaorth Oct 20, 2025
a689c46
WiP PN_NOTIFICATION_LOAD_SUCCESS
Vangaorth Oct 20, 2025
e7e0c09
PN_NOTIFICATION_LOAD_SUCCESS
Vangaorth Oct 21, 2025
23f92fd
Merge branch 'master' into IOCOM-2586_aarPhase2Tracking
Vangaorth Oct 21, 2025
8401668
PN_PAYMENT_STATUS
Vangaorth Oct 21, 2025
98cc498
Code cleaning
Vangaorth Oct 21, 2025
fad6468
Merge branch 'master' into IOCOM-2586_aarPhase2Tracking
Vangaorth Oct 22, 2025
3c2c0f6
Merge branch 'master' into IOCOM-2586_aarPhase2Tracking
Vangaorth Oct 22, 2025
7243eae
Merge branch 'master' into IOCOM-2586_aarPhase2Tracking
Vangaorth Oct 23, 2025
f24997a
WiP PN_ATTACHMENT_OPENING
Vangaorth Oct 23, 2025
5d23b90
PN_ATTACHMENT_OPENING
Vangaorth Oct 24, 2025
4646155
Merge branch 'master' into IOCOM-2586_aarPhase2Tracking
Vangaorth Oct 24, 2025
e938587
PN_PAYMENT_START
Vangaorth Oct 24, 2025
572090a
PN_SHOW_TIMELINE
Vangaorth Oct 24, 2025
c305e02
Merge branch 'master' into IOCOM-2586_aarPhase2Tracking
Vangaorth Oct 24, 2025
1e5adf9
Merge branch 'master' into IOCOM-2586_aarPhase2Tracking
Vangaorth Oct 27, 2025
4a0d52f
PN_SHOW_F24
Vangaorth Oct 27, 2025
e8f11a1
PN_TIMELINE_EXTERNAL
Vangaorth Oct 27, 2025
216f5f8
Merge branch 'master' into IOCOM-2586_aarPhase2Tracking
Vangaorth Oct 27, 2025
d7f57f3
SEND_TEMPORARY_NOTIFICATION_CLOSURE
Vangaorth Oct 27, 2025
f539b21
Moved to proper folder
Vangaorth Oct 27, 2025
9f82d1e
SEND_TEMPORARY_NOTIFICATION_CLOSURE_BACK
Vangaorth Oct 27, 2025
1e45385
Merge branch 'master' into IOCOM-2586_aarPhase2Tracking
Vangaorth Oct 27, 2025
c509e42
SEND_TEMPORARY_NOTIFICATION_CLOSURE_CONFIRM
Vangaorth Oct 27, 2025
3a9d5b8
SEND_TEMPORARY_NOTIFICATION_CLOSURE_EXIT
Vangaorth Oct 27, 2025
28da897
SEND_AAR_ERROR_CLOSURE
Vangaorth Oct 28, 2025
cd017e4
Merge branch 'master' into IOCOM-2586_aarPhase2Tracking
Vangaorth Oct 28, 2025
b780d2c
Merge branch 'master' into IOCOM-2586_aarPhase2Tracking
Vangaorth Oct 30, 2025
8d8bf75
Merge branch 'master' into IOCOM-2586_aarPhase2Tracking
Vangaorth Nov 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@ import I18n from "i18next";
import { ServiceId } from "../../../../../definitions/backend/ServiceId";
import { ThirdPartyAttachment } from "../../../../../definitions/backend/ThirdPartyAttachment";
import { useAttachmentDownload } from "../../hooks/useAttachmentDownload";
import {
SendOpeningSource,
SendUserType
} from "../../../pushNotifications/analytics";

export type MessageDetailsAttachmentItemProps = {
attachment: ThirdPartyAttachment;
bottomSpacer?: boolean;
disabled?: boolean;
isPN?: boolean;
sendOpeningSource: SendOpeningSource;
sendUserType: SendUserType;
messageId: string;
onPreNavigate?: () => void;
serviceId: ServiceId;
Expand All @@ -18,7 +23,8 @@ export const MessageDetailsAttachmentItem = ({
attachment,
bottomSpacer,
disabled = false,
isPN = false,
sendOpeningSource,
sendUserType,
messageId,
onPreNavigate = undefined,
serviceId
Expand All @@ -27,7 +33,8 @@ export const MessageDetailsAttachmentItem = ({
useAttachmentDownload(
messageId,
attachment,
isPN,
sendOpeningSource,
sendUserType,
serviceId,
onPreNavigate
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,34 @@ import { ServiceId } from "../../../../../definitions/backend/ServiceId";
import { useIOSelector } from "../../../../store/hooks";
import { thirdPartyMessageAttachments } from "../../store/reducers/thirdPartyById";
import { ATTACHMENT_CATEGORY } from "../../types/attachmentCategory";
import {
SendOpeningSource,
SendUserType
} from "../../../pushNotifications/analytics";
import { MessageDetailsAttachmentItem } from "./MessageDetailsAttachmentItem";

export type MessageDetailsAttachmentsProps = {
banner?: ReactNode;
disabled?: boolean;
isPN?: boolean;
messageId: string;
serviceId: ServiceId;
sendOpeningSource: SendOpeningSource;
sendUserType: SendUserType;
};

export const MessageDetailsAttachments = ({
banner,
disabled = false,
isPN = false,
messageId,
serviceId
serviceId,
sendOpeningSource,
sendUserType
}: MessageDetailsAttachmentsProps) => {
const originalAttachments = useIOSelector(state =>
thirdPartyMessageAttachments(state, messageId)
);
const attachments = isPN
const isSend = sendUserType !== "not_set";
const attachments = isSend
? originalAttachments.filter(
attachment => attachment.category !== ATTACHMENT_CATEGORY.F24
)
Expand All @@ -47,7 +54,8 @@ export const MessageDetailsAttachments = ({
<MessageDetailsAttachmentItem
attachment={attachment}
bottomSpacer={index + 1 < attachmentCount}
isPN={isPN}
sendOpeningSource={sendOpeningSource}
sendUserType={sendUserType}
disabled={disabled}
key={`MessageAttachment_${index}`}
messageId={messageId}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ export const MessageDetailsPayment = ({
noticeNumber={paymentData.noticeNumber}
rptId={rptId}
serviceId={serviceId}
sendOpeningSource={"not_set"}
sendUserType={"not_set"}
/>
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ import { formatPaymentNoticeNumber } from "../../../payments/common/utils";
import { ServiceId } from "../../../../../definitions/backend/ServiceId";
import { trackPNPaymentStart } from "../../../pn/analytics";
import { formatAndValidateDueDate } from "../../../payments/checkout/utils";
import {
SendOpeningSource,
SendUserType
} from "../../../pushNotifications/analytics";
import {
computeAndTrackPaymentStart,
shouldUpdatePaymentUponReturning
Expand All @@ -55,6 +59,8 @@ type MessagePaymentItemProps = {
noticeNumber: string;
paymentAmount?: PaymentAmount;
rptId: string;
sendOpeningSource: SendOpeningSource;
sendUserType: SendUserType;
serviceId: ServiceId;
willNavigateToPayment?: () => void;
};
Expand Down Expand Up @@ -175,6 +181,8 @@ export const MessagePaymentItem = ({
noSpaceOnTop = false,
noticeNumber,
rptId,
sendOpeningSource,
sendUserType,
serviceId,
willNavigateToPayment = undefined
}: MessagePaymentItemProps) => {
Expand Down Expand Up @@ -205,7 +213,7 @@ export const MessagePaymentItem = ({
dispatch,
() => {
if (isPNPayment) {
trackPNPaymentStart();
trackPNPaymentStart(sendOpeningSource, sendUserType);
} else {
computeAndTrackPaymentStart(serviceId, store.getState());
}
Expand All @@ -219,6 +227,8 @@ export const MessagePaymentItem = ({
isPNPayment,
paymentStatusForUI,
rptId,
sendOpeningSource,
sendUserType,
serviceId,
store,
toast,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ export const MessageDetailsAttachmentItem = ({
attachment,
bottomSpacer,
disabled,
isPN,
sendOpeningSource,
sendUserType,
messageId,
onPreNavigate,
serviceId
Expand All @@ -21,7 +22,8 @@ export const MessageDetailsAttachmentItem = ({
</View>
<View>{`Has${bottomSpacer ? "" : " no"} bottom spacer`}</View>
<View>{`Is ${disabled ? "" : "not "}disabled`}</View>
<View>{`Is ${isPN ? "" : "not "}SEND`}</View>
<View>{`Send Opening Source ${sendOpeningSource}`}</View>
<View>{`Send User Type ${sendUserType}`}</View>
<View>{`Message Id: ${messageId}`}</View>
<View>{`Service Id: ${serviceId}`}</View>
<Pressable accessibilityLabel="" onPress={onPreNavigate}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@ import { MessageDetailsAttachmentsProps } from "../MessageDetailsAttachments";
export const MessageDetailsAttachments = ({
banner,
disabled,
isPN,
messageId,
serviceId
serviceId,
sendOpeningSource,
sendUserType
}: MessageDetailsAttachmentsProps) => (
<>
<View>Mock MessageDetailsAttachments</View>
<View>{`${banner ? "Has" : "Does not have"} Banner`}</View>
<View>{`Is ${disabled ? "" : "not "}disabled`}</View>
<View>{`Is ${isPN ? "" : "not "}SEND`}</View>
<View>{`Send Opening Source ${sendOpeningSource}`}</View>
<View>{`Send User Type ${sendUserType}`}</View>
<View>{`Message Id: ${messageId}`}</View>
<View>{`Service Id: ${serviceId}`}</View>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,85 +6,79 @@ import { renderScreenWithNavigationStoreContext } from "../../../../../utils/tes
import { MessageDetailsAttachmentItem } from "../MessageDetailsAttachmentItem";
import { ThirdPartyAttachment } from "../../../../../../definitions/backend/ThirdPartyAttachment";
import { ServiceId } from "../../../../../../definitions/backend/ServiceId";
import { MESSAGES_ROUTES } from "../../../navigation/routes";
import {
SendOpeningSource,
SendUserType
} from "../../../../pushNotifications/analytics";

describe("MessageDetailsAttachmentItem", () => {
it("Should match snapshot with required parameters", () => {
const messageId = "01HNWXJG52YS359GWSYSRK2BWC";
const serviceId = "01HNWXKWAGWPHV7VGMQ21EZPSA" as ServiceId;
const thirdPartyAttachment = {
id: "1",
url: "https://invalid.url",
content_type: "application/pdf",
name: "A PDF File",
category: "DOCUMENT"
} as ThirdPartyAttachment;
const messageId = "01HNWXJG52YS359GWSYSRK2BWC";
const serviceId = "01HNWXKWAGWPHV7VGMQ21EZPSA" as ServiceId;
const thirdPartyAttachments: ReadonlyArray<ThirdPartyAttachment> = [
{
id: "1",
url: "https://invalid.url",
content_type: "application/pdf",
category: "DOCUMENT"
} as ThirdPartyAttachment,
{
id: "1",
url: "https://invalid.url",
content_type: "application/pdf",
name: "A PDF File",
category: "DOCUMENT"
} as ThirdPartyAttachment
];

const component = renderScreen(thirdPartyAttachment, messageId, serviceId);
expect(component.toJSON()).toMatchSnapshot();
});
it("Should match snapshot with all parameters", () => {
const messageId = "01HNWXJG52YS359GWSYSRK2BWC";
const thirdPartyAttachment = {
id: "1",
url: "https://invalid.url",
content_type: "application/pdf",
name: "A PDF File",
category: "DOCUMENT"
} as ThirdPartyAttachment;
const serviceId = "01HNWXKWAGWPHV7VGMQ21EZPSA" as ServiceId;

const component = renderScreen(
thirdPartyAttachment,
messageId,
serviceId,
true,
false,
true
);
expect(component.toJSON()).toMatchSnapshot();
});
it("Should match snapshot when the attachment has no name", () => {
const messageId = "01HNWXJG52YS359GWSYSRK2BWC";
const serviceId = "01HNWXKWAGWPHV7VGMQ21EZPSA" as ServiceId;
const thirdPartyAttachment = {
id: "1",
url: "https://invalid.url",
content_type: "application/pdf",
category: "DOCUMENT"
} as ThirdPartyAttachment;

const component = renderScreen(thirdPartyAttachment, messageId, serviceId);
expect(component.toJSON()).toMatchSnapshot();
});
it("Should match snapshot when is fetching the attachment", () => {
const messageId = "01HNWXJG52YS359GWSYSRK2BWC";
const serviceId = "01HNWXKWAGWPHV7VGMQ21EZPSA" as ServiceId;
const thirdPartyAttachment = {
id: "1",
url: "https://invalid.url",
content_type: "application/pdf",
category: "DOCUMENT"
} as ThirdPartyAttachment;
const sendOpeningSources: ReadonlyArray<SendOpeningSource> = [
"aar",
"message",
"not_set"
];
const sendUserTypes: ReadonlyArray<SendUserType> = [
"mandatory",
"not_set",
"recipient"
];

const component = renderScreen(
thirdPartyAttachment,
messageId,
serviceId,
undefined,
true,
false
);
expect(component.toJSON()).toMatchSnapshot();
thirdPartyAttachments.forEach(thirdPartyAttachment => {
// eslint-disable-next-line sonarjs/cognitive-complexity
[false, true].forEach(isFetching => {
[undefined, false, true].forEach(showBottomSpacer => {
[undefined, false, true].forEach(isDisabled => {
sendOpeningSources.forEach(sendOpeningSource => {
sendUserTypes.forEach(sendUserType => {
it(`should match snapshot (attachment ${
thirdPartyAttachment.name ? "with" : "without"
} name, ${isFetching ? "" : "not "}fetching, ${
showBottomSpacer ? "with" : "without"
} bottom spacer, ${
isDisabled ? "disabled" : "enabled"
}, opening source ${sendOpeningSource}, user type ${sendUserType})`, () => {
const component = renderScreen(
thirdPartyAttachment,
isFetching,
showBottomSpacer,
isDisabled,
sendOpeningSource,
sendUserType
);
expect(component.toJSON()).toMatchSnapshot();
});
});
});
});
});
});
});

const renderScreen = (
attachment: ThirdPartyAttachment,
messageId: string,
serviceId: ServiceId,
bottomSpacer?: boolean,
isFetching?: boolean,
disabled?: boolean
isFetching: boolean,
bottomSpacer: boolean | undefined,
disabled: boolean | undefined,
sendOpeningSource: SendOpeningSource,
sendUserType: SendUserType
) => {
const initialState = appReducer(undefined, applicationChangeState("active"));
const finalState = appReducer(
Expand Down Expand Up @@ -112,9 +106,11 @@ const renderScreen = (
disabled={disabled}
messageId={messageId}
serviceId={serviceId}
sendOpeningSource={sendOpeningSource}
sendUserType={sendUserType}
/>
),
"DUMMY",
MESSAGES_ROUTES.MESSAGE_DETAIL,
{},
store
);
Expand Down
Loading
Loading