@capillarytech/creatives-library 8.0.353-alpha.3 → 8.0.353-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/package.json +1 -1
  2. package/v2Components/CommonTestAndPreview/UnifiedPreview/PreviewHeader.js +17 -0
  3. package/v2Components/CommonTestAndPreview/UnifiedPreview/ViberPreviewContent.js +14 -132
  4. package/v2Components/CommonTestAndPreview/UnifiedPreview/WebPushPreviewContent.js +169 -0
  5. package/v2Components/CommonTestAndPreview/UnifiedPreview/_unifiedPreview.scss +70 -163
  6. package/v2Components/CommonTestAndPreview/UnifiedPreview/index.js +44 -5
  7. package/v2Components/CommonTestAndPreview/constants.js +2 -0
  8. package/v2Components/CommonTestAndPreview/index.js +58 -49
  9. package/v2Components/CommonTestAndPreview/tests/UnifiedPreview/PreviewHeader.test.js +159 -0
  10. package/v2Components/CommonTestAndPreview/tests/UnifiedPreview/ViberPreviewContent.test.js +0 -364
  11. package/v2Components/CommonTestAndPreview/tests/UnifiedPreview/WebPushPreviewContent.test.js +522 -0
  12. package/v2Components/CommonTestAndPreview/tests/UnifiedPreview/index.test.js +255 -0
  13. package/v2Components/CommonTestAndPreview/tests/constants.test.js +2 -1
  14. package/v2Components/CommonTestAndPreview/tests/index.test.js +194 -0
  15. package/v2Components/TestAndPreviewSlidebox/index.js +2 -2
  16. package/v2Containers/App/constants.js +3 -0
  17. package/v2Containers/App/tests/constants.test.js +61 -0
  18. package/v2Containers/Templates/_templates.scss +0 -77
  19. package/v2Containers/Templates/index.js +70 -77
  20. package/v2Containers/Templates/tests/webpush.test.js +375 -0
  21. package/v2Containers/Viber/constants.js +0 -19
  22. package/v2Containers/Viber/index.js +47 -714
  23. package/v2Containers/Viber/index.scss +0 -148
  24. package/v2Containers/Viber/messages.js +0 -116
  25. package/v2Containers/Viber/tests/index.test.js +0 -80
  26. package/v2Containers/WebPush/Create/index.js +91 -8
  27. package/v2Containers/WebPush/Create/index.scss +7 -0
  28. package/v2Containers/WebPush/Create/tests/getTemplateContent.test.js +338 -0
  29. package/v2Containers/WebPush/Create/tests/testAndPreviewIntegration.test.js +325 -0
@@ -119,6 +119,21 @@ jest.mock('../../UnifiedPreview/ZaloPreviewContent', () => ({
119
119
  ),
120
120
  }));
121
121
 
122
+ jest.mock('../../UnifiedPreview/WebPushPreviewContent', () => ({
123
+ __esModule: true,
124
+ default: (props) => (
125
+ <div data-testid="webpush-preview">
126
+ <div data-testid="webpush-title">{props.notificationTitle}</div>
127
+ <div data-testid="webpush-body">{props.notificationBody}</div>
128
+ <div data-testid="webpush-image">{props.imageSrc}</div>
129
+ <div data-testid="webpush-icon">{props.brandIconSrc}</div>
130
+ <div data-testid="webpush-url">{props.url}</div>
131
+ <div data-testid="webpush-buttons">{JSON.stringify(props.buttons)}</div>
132
+ <div data-testid="webpush-fullscreen">{props.isFullscreenOpen ? 'true' : 'false'}</div>
133
+ </div>
134
+ ),
135
+ }));
136
+
122
137
  jest.mock('../../UnifiedPreview/PreviewHeader', () => ({
123
138
  __esModule: true,
124
139
  default: (props) => (
@@ -976,4 +991,244 @@ describe('UnifiedPreview', () => {
976
991
  consoleSpy.mockRestore();
977
992
  });
978
993
  });
994
+
995
+ describe('Channel Routing - WEBPUSH', () => {
996
+ it('should render WebPushPreviewContent for WEBPUSH channel with object content', () => {
997
+ const content = {
998
+ content: {
999
+ title: 'Hello World',
1000
+ message: 'This is a notification',
1001
+ iconImageUrl: 'https://example.com/icon.png',
1002
+ cta: { actionLink: 'https://example.com' },
1003
+ expandableDetails: {
1004
+ media: [{ url: 'https://example.com/image.jpg' }],
1005
+ ctas: [{ title: 'Click me', actionLink: 'https://example.com/btn', type: 'EXTERNAL_URL' }],
1006
+ },
1007
+ },
1008
+ };
1009
+ const props = { ...defaultProps, channel: CHANNELS.WEBPUSH, content };
1010
+
1011
+ render(
1012
+ <TestWrapper>
1013
+ <ComponentToRender {...props} />
1014
+ </TestWrapper>
1015
+ );
1016
+
1017
+ expect(screen.getByTestId('webpush-preview')).toBeTruthy();
1018
+ expect(screen.getByTestId('webpush-title')).toHaveTextContent('Hello World');
1019
+ expect(screen.getByTestId('webpush-body')).toHaveTextContent('This is a notification');
1020
+ expect(screen.getByTestId('webpush-icon')).toHaveTextContent('https://example.com/icon.png');
1021
+ expect(screen.getByTestId('webpush-url')).toHaveTextContent('https://example.com');
1022
+ });
1023
+
1024
+ it('should render WebPushPreviewContent for WEBPUSH channel with JSON string content', () => {
1025
+ const contentObj = {
1026
+ content: {
1027
+ title: 'Push Title',
1028
+ message: 'Push message body',
1029
+ iconImageUrl: 'https://example.com/brand.png',
1030
+ },
1031
+ };
1032
+ const props = {
1033
+ ...defaultProps,
1034
+ channel: CHANNELS.WEBPUSH,
1035
+ content: JSON.stringify(contentObj),
1036
+ };
1037
+
1038
+ render(
1039
+ <TestWrapper>
1040
+ <ComponentToRender {...props} />
1041
+ </TestWrapper>
1042
+ );
1043
+
1044
+ expect(screen.getByTestId('webpush-preview')).toBeTruthy();
1045
+ expect(screen.getByTestId('webpush-title')).toHaveTextContent('Push Title');
1046
+ expect(screen.getByTestId('webpush-body')).toHaveTextContent('Push message body');
1047
+ expect(screen.getByTestId('webpush-icon')).toHaveTextContent('https://example.com/brand.png');
1048
+ });
1049
+
1050
+ it('should fallback to empty object when JSON parse fails', () => {
1051
+ const props = {
1052
+ ...defaultProps,
1053
+ channel: CHANNELS.WEBPUSH,
1054
+ content: 'INVALID_JSON{{{{',
1055
+ };
1056
+
1057
+ render(
1058
+ <TestWrapper>
1059
+ <ComponentToRender {...props} />
1060
+ </TestWrapper>
1061
+ );
1062
+
1063
+ expect(screen.getByTestId('webpush-preview')).toBeTruthy();
1064
+ expect(screen.getByTestId('webpush-title')).toHaveTextContent('');
1065
+ expect(screen.getByTestId('webpush-body')).toHaveTextContent('');
1066
+ });
1067
+
1068
+ it('should fallback to empty object when content is null', () => {
1069
+ const props = { ...defaultProps, channel: CHANNELS.WEBPUSH, content: null };
1070
+
1071
+ render(
1072
+ <TestWrapper>
1073
+ <ComponentToRender {...props} />
1074
+ </TestWrapper>
1075
+ );
1076
+
1077
+ expect(screen.getByTestId('webpush-preview')).toBeTruthy();
1078
+ expect(screen.getByTestId('webpush-title')).toHaveTextContent('');
1079
+ });
1080
+
1081
+ it('should extract imageSrc from expandableDetails.media[0].url', () => {
1082
+ const content = {
1083
+ content: {
1084
+ title: 'T',
1085
+ message: 'M',
1086
+ expandableDetails: {
1087
+ media: [{ url: 'https://example.com/media.jpg' }],
1088
+ ctas: [],
1089
+ },
1090
+ },
1091
+ };
1092
+ const props = { ...defaultProps, channel: CHANNELS.WEBPUSH, content };
1093
+
1094
+ render(
1095
+ <TestWrapper>
1096
+ <ComponentToRender {...props} />
1097
+ </TestWrapper>
1098
+ );
1099
+
1100
+ expect(screen.getByTestId('webpush-image')).toHaveTextContent('https://example.com/media.jpg');
1101
+ });
1102
+
1103
+ it('should pass empty imageSrc when media array is empty', () => {
1104
+ const content = {
1105
+ content: {
1106
+ title: 'T',
1107
+ message: 'M',
1108
+ expandableDetails: { media: [], ctas: [] },
1109
+ },
1110
+ };
1111
+ const props = { ...defaultProps, channel: CHANNELS.WEBPUSH, content };
1112
+
1113
+ render(
1114
+ <TestWrapper>
1115
+ <ComponentToRender {...props} />
1116
+ </TestWrapper>
1117
+ );
1118
+
1119
+ expect(screen.getByTestId('webpush-image')).toHaveTextContent('');
1120
+ });
1121
+
1122
+ it('should map CTA buttons from expandableDetails.ctas', () => {
1123
+ const content = {
1124
+ content: {
1125
+ title: 'T',
1126
+ message: 'M',
1127
+ expandableDetails: {
1128
+ media: [],
1129
+ ctas: [
1130
+ { title: 'Btn1', actionLink: 'https://a.com', type: 'EXTERNAL_URL' },
1131
+ { title: 'Btn2', actionLink: 'https://b.com', type: 'SITE_URL' },
1132
+ ],
1133
+ },
1134
+ },
1135
+ };
1136
+ const props = { ...defaultProps, channel: CHANNELS.WEBPUSH, content };
1137
+
1138
+ render(
1139
+ <TestWrapper>
1140
+ <ComponentToRender {...props} />
1141
+ </TestWrapper>
1142
+ );
1143
+
1144
+ const buttons = JSON.parse(screen.getByTestId('webpush-buttons').textContent);
1145
+ expect(buttons).toHaveLength(2);
1146
+ expect(buttons[0]).toEqual({ text: 'Btn1', url: 'https://a.com', type: 'EXTERNAL_URL' });
1147
+ expect(buttons[1]).toEqual({ text: 'Btn2', url: 'https://b.com', type: 'SITE_URL' });
1148
+ });
1149
+
1150
+ it('should pass empty buttons array when no ctas', () => {
1151
+ const content = { content: { title: 'T', message: 'M' } };
1152
+ const props = { ...defaultProps, channel: CHANNELS.WEBPUSH, content };
1153
+
1154
+ render(
1155
+ <TestWrapper>
1156
+ <ComponentToRender {...props} />
1157
+ </TestWrapper>
1158
+ );
1159
+
1160
+ const buttons = JSON.parse(screen.getByTestId('webpush-buttons').textContent);
1161
+ expect(buttons).toEqual([]);
1162
+ });
1163
+
1164
+ it('should NOT show device toggle for WEBPUSH channel', () => {
1165
+ const props = {
1166
+ ...defaultProps,
1167
+ channel: CHANNELS.WEBPUSH,
1168
+ showDeviceToggle: true,
1169
+ showHeader: true,
1170
+ selectedCustomer: { name: 'Alice' },
1171
+ };
1172
+
1173
+ render(
1174
+ <TestWrapper>
1175
+ <ComponentToRender {...props} />
1176
+ </TestWrapper>
1177
+ );
1178
+
1179
+ // PreviewHeader is mocked - verify it receives showDeviceToggle=false for WEBPUSH
1180
+ const header = screen.getByTestId('preview-header');
1181
+ expect(header).toBeTruthy();
1182
+ });
1183
+
1184
+ it('should include WEBPUSH in supported channels list', () => {
1185
+ const props = { ...defaultProps, channel: CHANNELS.WEBPUSH, content: {} };
1186
+
1187
+ render(
1188
+ <TestWrapper>
1189
+ <ComponentToRender {...props} />
1190
+ </TestWrapper>
1191
+ );
1192
+
1193
+ // WEBPUSH should render WebPushPreviewContent, not the unsupported placeholder
1194
+ expect(screen.getByTestId('webpush-preview')).toBeTruthy();
1195
+ expect(screen.queryByText(/Coming Soon/)).toBeNull();
1196
+ });
1197
+
1198
+ it('should pass isUpdating to WebPushPreviewContent in loading state', () => {
1199
+ const props = {
1200
+ ...defaultProps,
1201
+ channel: CHANNELS.WEBPUSH,
1202
+ content: { content: { title: 'T', message: 'M' } },
1203
+ isUpdating: true,
1204
+ };
1205
+
1206
+ render(
1207
+ <TestWrapper>
1208
+ <ComponentToRender {...props} />
1209
+ </TestWrapper>
1210
+ );
1211
+
1212
+ // When isUpdating, component shows loading spinner, not WebPushPreviewContent
1213
+ expect(screen.queryByTestId('webpush-preview')).toBeNull();
1214
+ });
1215
+
1216
+ it('should pass error to WebPushPreviewContent in error state', () => {
1217
+ const props = {
1218
+ ...defaultProps,
1219
+ channel: CHANNELS.WEBPUSH,
1220
+ content: { content: { title: 'T', message: 'M' } },
1221
+ error: 'Network error',
1222
+ };
1223
+
1224
+ render(
1225
+ <TestWrapper>
1226
+ <ComponentToRender {...props} />
1227
+ </TestWrapper>
1228
+ );
1229
+
1230
+ // When error, component shows error state, not WebPushPreviewContent
1231
+ expect(screen.queryByTestId('webpush-preview')).toBeNull();
1232
+ });
1233
+ });
979
1234
  });
@@ -179,10 +179,11 @@ describe('CommonTestAndPreview Constants', () => {
179
179
  expect(CHANNELS.MOBILEPUSH).toBe('MOBILEPUSH');
180
180
  expect(CHANNELS.VIBER).toBe('VIBER');
181
181
  expect(CHANNELS.ZALO).toBe('ZALO');
182
+ expect(CHANNELS.WEBPUSH).toBe('WEBPUSH');
182
183
  });
183
184
 
184
185
  it('should have all required channel keys', () => {
185
- const expectedChannels = ['EMAIL', 'SMS', 'RCS', 'WHATSAPP', 'INAPP', 'MOBILEPUSH', 'VIBER', 'ZALO'];
186
+ const expectedChannels = ['EMAIL', 'SMS', 'RCS', 'WHATSAPP', 'INAPP', 'MOBILEPUSH', 'VIBER', 'ZALO', 'WEBPUSH'];
186
187
  expect(Object.keys(CHANNELS)).toEqual(expect.arrayContaining(expectedChannels));
187
188
  expect(Object.keys(CHANNELS).length).toBe(expectedChannels.length);
188
189
  });
@@ -1174,6 +1174,50 @@ describe('CommonTestAndPreview', () => {
1174
1174
  expect(screen.getByTestId('preview-section')).toBeTruthy();
1175
1175
  });
1176
1176
  });
1177
+
1178
+ it('should handle WEBPUSH channel', async () => {
1179
+ const webpushContent = {
1180
+ content: { title: 'Web Push', message: 'Hello from web push' },
1181
+ accountId: 'acc-001',
1182
+ };
1183
+ const props = {
1184
+ ...defaultProps,
1185
+ channel: CHANNELS.WEBPUSH,
1186
+ content: webpushContent,
1187
+ };
1188
+
1189
+ render(
1190
+ <TestWrapper>
1191
+ <CommonTestAndPreview {...props} />
1192
+ </TestWrapper>
1193
+ );
1194
+
1195
+ await waitFor(() => {
1196
+ expect(screen.getByTestId('left-panel')).toBeTruthy();
1197
+ expect(screen.getByTestId('preview-section')).toBeTruthy();
1198
+ });
1199
+ });
1200
+
1201
+ it('should treat WEBPUSH content as object (same branch as WHATSAPP)', async () => {
1202
+ // The WEBPUSH channel uses the same contentObj branch as WHATSAPP (JSON string or object)
1203
+ const props = {
1204
+ ...defaultProps,
1205
+ channel: CHANNELS.WEBPUSH,
1206
+ content: JSON.stringify({
1207
+ content: { title: 'Stringified', message: 'Content' },
1208
+ }),
1209
+ };
1210
+
1211
+ render(
1212
+ <TestWrapper>
1213
+ <CommonTestAndPreview {...props} />
1214
+ </TestWrapper>
1215
+ );
1216
+
1217
+ await waitFor(() => {
1218
+ expect(screen.getByTestId('preview-section')).toBeTruthy();
1219
+ });
1220
+ });
1177
1221
  });
1178
1222
 
1179
1223
  describe('Device Initialization', () => {
@@ -2629,6 +2673,156 @@ describe('CommonTestAndPreview', () => {
2629
2673
  });
2630
2674
  });
2631
2675
  });
2676
+
2677
+ describe('preparePreviewPayload - WEBPUSH', () => {
2678
+ it('should build WEBPUSH payload with title and message', async () => {
2679
+ const webpushContent = {
2680
+ content: {
2681
+ title: 'Push Title',
2682
+ message: 'Push message body',
2683
+ },
2684
+ accountId: 'acc-123',
2685
+ messageSubject: 'Push Title',
2686
+ };
2687
+ const props = {
2688
+ ...defaultProps,
2689
+ channel: CHANNELS.WEBPUSH,
2690
+ content: JSON.stringify(webpushContent),
2691
+ };
2692
+
2693
+ render(
2694
+ <TestWrapper>
2695
+ <CommonTestAndPreview {...props} />
2696
+ </TestWrapper>
2697
+ );
2698
+
2699
+ await waitFor(() => {
2700
+ expect(screen.getByTestId('left-panel')).toBeTruthy();
2701
+ expect(screen.getByTestId('preview-section')).toBeTruthy();
2702
+ });
2703
+ });
2704
+
2705
+ it('should handle WEBPUSH content with iconImageUrl', async () => {
2706
+ const webpushContent = {
2707
+ content: {
2708
+ title: 'Hello',
2709
+ message: 'World',
2710
+ iconImageUrl: 'https://example.com/icon.png',
2711
+ },
2712
+ accountId: 'acc-123',
2713
+ };
2714
+ const props = {
2715
+ ...defaultProps,
2716
+ channel: CHANNELS.WEBPUSH,
2717
+ content: webpushContent,
2718
+ };
2719
+
2720
+ render(
2721
+ <TestWrapper>
2722
+ <CommonTestAndPreview {...props} />
2723
+ </TestWrapper>
2724
+ );
2725
+
2726
+ await waitFor(() => {
2727
+ expect(screen.getByTestId('preview-section')).toBeTruthy();
2728
+ });
2729
+ });
2730
+
2731
+ it('should handle WEBPUSH content with cta', async () => {
2732
+ const webpushContent = {
2733
+ content: {
2734
+ title: 'Hello',
2735
+ message: 'World',
2736
+ cta: { type: 'EXTERNAL_URL', actionLink: 'https://example.com' },
2737
+ },
2738
+ accountId: 'acc-123',
2739
+ };
2740
+ const props = {
2741
+ ...defaultProps,
2742
+ channel: CHANNELS.WEBPUSH,
2743
+ content: webpushContent,
2744
+ };
2745
+
2746
+ render(
2747
+ <TestWrapper>
2748
+ <CommonTestAndPreview {...props} />
2749
+ </TestWrapper>
2750
+ );
2751
+
2752
+ await waitFor(() => {
2753
+ expect(screen.getByTestId('preview-section')).toBeTruthy();
2754
+ });
2755
+ });
2756
+
2757
+ it('should handle WEBPUSH content with expandableDetails', async () => {
2758
+ const webpushContent = {
2759
+ content: {
2760
+ title: 'Hello',
2761
+ message: 'World',
2762
+ expandableDetails: {
2763
+ media: [{ url: 'https://example.com/image.jpg', type: 'IMAGE' }],
2764
+ ctas: [{ title: 'Click', actionLink: 'https://example.com', type: 'EXTERNAL_URL' }],
2765
+ },
2766
+ },
2767
+ accountId: 'acc-123',
2768
+ };
2769
+ const props = {
2770
+ ...defaultProps,
2771
+ channel: CHANNELS.WEBPUSH,
2772
+ content: webpushContent,
2773
+ };
2774
+
2775
+ render(
2776
+ <TestWrapper>
2777
+ <CommonTestAndPreview {...props} />
2778
+ </TestWrapper>
2779
+ );
2780
+
2781
+ await waitFor(() => {
2782
+ expect(screen.getByTestId('preview-section')).toBeTruthy();
2783
+ });
2784
+ });
2785
+
2786
+ it('should handle WEBPUSH with null formData gracefully', async () => {
2787
+ const props = {
2788
+ ...defaultProps,
2789
+ channel: CHANNELS.WEBPUSH,
2790
+ formData: null,
2791
+ content: null,
2792
+ };
2793
+
2794
+ render(
2795
+ <TestWrapper>
2796
+ <CommonTestAndPreview {...props} />
2797
+ </TestWrapper>
2798
+ );
2799
+
2800
+ await waitFor(() => {
2801
+ expect(screen.getByTestId('preview-section')).toBeTruthy();
2802
+ });
2803
+ });
2804
+
2805
+ it('should handle WEBPUSH channel with object content (non-string)', async () => {
2806
+ const props = {
2807
+ ...defaultProps,
2808
+ channel: CHANNELS.WEBPUSH,
2809
+ content: {
2810
+ content: { title: 'ObjTitle', message: 'ObjMessage' },
2811
+ accountId: 'acc-999',
2812
+ },
2813
+ };
2814
+
2815
+ render(
2816
+ <TestWrapper>
2817
+ <CommonTestAndPreview {...props} />
2818
+ </TestWrapper>
2819
+ );
2820
+
2821
+ await waitFor(() => {
2822
+ expect(screen.getByTestId('preview-section')).toBeTruthy();
2823
+ });
2824
+ });
2825
+ });
2632
2826
  });
2633
2827
 
2634
2828
  describe('Tag Extraction', () => {
@@ -69,8 +69,8 @@ const TestAndPreviewSlidebox = (props) => {
69
69
 
70
70
  TestAndPreviewSlidebox.propTypes = {
71
71
  // Channel prop - supports all channels
72
- channel: PropTypes.oneOf([CHANNELS.EMAIL, CHANNELS.SMS, CHANNELS.RCS, CHANNELS.WHATSAPP, CHANNELS.INAPP, CHANNELS.MOBILEPUSH]),
73
- currentChannel: PropTypes.oneOf([CHANNELS.EMAIL, CHANNELS.SMS, CHANNELS.RCS, CHANNELS.WHATSAPP, CHANNELS.INAPP, CHANNELS.MOBILEPUSH]), // Alternative prop name for backward compatibility
72
+ channel: PropTypes.oneOf([CHANNELS.EMAIL, CHANNELS.SMS, CHANNELS.RCS, CHANNELS.WHATSAPP, CHANNELS.INAPP, CHANNELS.MOBILEPUSH, CHANNELS.VIBER, CHANNELS.ZALO, CHANNELS.WEBPUSH]),
73
+ currentChannel: PropTypes.oneOf([CHANNELS.EMAIL, CHANNELS.SMS, CHANNELS.RCS, CHANNELS.WHATSAPP, CHANNELS.INAPP, CHANNELS.MOBILEPUSH, CHANNELS.VIBER, CHANNELS.ZALO, CHANNELS.WEBPUSH]), // Alternative prop name for backward compatibility
74
74
  // All original props are passed through
75
75
  show: PropTypes.bool.isRequired,
76
76
  onClose: PropTypes.func.isRequired,
@@ -124,3 +124,6 @@ export const LOYALTY = 'loyalty';
124
124
  export const FAILURE = 'FAILURE';
125
125
  export const DATE_DISPLAY_FORMAT = 'D MMM YYYY';
126
126
  export const TIME_DISPLAY_FORMAT = 'hh:mm A';
127
+ export const EXTERNAL_URL = 'EXTERNAL_URL';
128
+ export const URL = 'URL';
129
+ export const SITE_URL = 'SITE_URL';
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Tests for App container constants
3
+ *
4
+ * Covers newly added URL type constants: EXTERNAL_URL, URL, SITE_URL
5
+ */
6
+
7
+ import {
8
+ EXTERNAL_URL,
9
+ URL,
10
+ SITE_URL,
11
+ LOYALTY,
12
+ FAILURE,
13
+ DATE_DISPLAY_FORMAT,
14
+ TIME_DISPLAY_FORMAT,
15
+ } from '../constants';
16
+
17
+ describe('App constants', () => {
18
+ describe('URL type constants', () => {
19
+ it('should export EXTERNAL_URL with correct value', () => {
20
+ expect(EXTERNAL_URL).toBe('EXTERNAL_URL');
21
+ });
22
+
23
+ it('should export URL with correct value', () => {
24
+ expect(URL).toBe('URL');
25
+ });
26
+
27
+ it('should export SITE_URL with correct value', () => {
28
+ expect(SITE_URL).toBe('SITE_URL');
29
+ });
30
+
31
+ it('should have distinct values for all three URL constants', () => {
32
+ expect(EXTERNAL_URL).not.toBe(URL);
33
+ expect(EXTERNAL_URL).not.toBe(SITE_URL);
34
+ expect(URL).not.toBe(SITE_URL);
35
+ });
36
+
37
+ it('should be strings', () => {
38
+ expect(typeof EXTERNAL_URL).toBe('string');
39
+ expect(typeof URL).toBe('string');
40
+ expect(typeof SITE_URL).toBe('string');
41
+ });
42
+ });
43
+
44
+ describe('Other existing constants still exported correctly', () => {
45
+ it('should export LOYALTY', () => {
46
+ expect(LOYALTY).toBe('loyalty');
47
+ });
48
+
49
+ it('should export FAILURE', () => {
50
+ expect(FAILURE).toBe('FAILURE');
51
+ });
52
+
53
+ it('should export DATE_DISPLAY_FORMAT', () => {
54
+ expect(DATE_DISPLAY_FORMAT).toBe('D MMM YYYY');
55
+ });
56
+
57
+ it('should export TIME_DISPLAY_FORMAT', () => {
58
+ expect(TIME_DISPLAY_FORMAT).toBe('hh:mm A');
59
+ });
60
+ });
61
+ });
@@ -153,83 +153,6 @@
153
153
  line-clamp: 3;
154
154
  }
155
155
  }
156
- .viber-carousel-static-content {
157
- width: 100%;
158
- overflow: hidden;
159
- .viber-carousel-static-message-box {
160
- width: 100%;
161
- height: 2.25rem;
162
- border-radius: $CAP_SPACE_04;
163
- background: $CAP_WHITE;
164
- margin-bottom: $CAP_SPACE_08;
165
- padding: 0 $CAP_SPACE_08;
166
- display: flex;
167
- align-items: center;
168
- }
169
- .viber-carousel-static-message {
170
- display: block;
171
- width: 100%;
172
- color: $CAP_G01;
173
- overflow: hidden;
174
- text-overflow: ellipsis;
175
- white-space: nowrap;
176
- }
177
- .viber-carousel-static-cards {
178
- display: flex;
179
- gap: $CAP_SPACE_08;
180
- overflow: hidden;
181
- }
182
- .viber-carousel-static-card {
183
- flex: 1;
184
- min-width: 0;
185
- background: $CAP_WHITE;
186
- border-radius: $CAP_SPACE_04;
187
- padding: $CAP_SPACE_06;
188
- overflow: hidden;
189
- }
190
- .viber-carousel-static-image,
191
- .viber-carousel-static-image-placeholder {
192
- width: 100%;
193
- height: 5.357rem;
194
- border-radius: $CAP_SPACE_04;
195
- }
196
- .viber-carousel-static-image {
197
- object-fit: cover;
198
- }
199
- .viber-carousel-static-image-placeholder {
200
- background: $CAP_G07;
201
- }
202
- .viber-carousel-static-text {
203
- display: block;
204
- color: $CAP_G01;
205
- margin: $CAP_SPACE_04 0;
206
- line-height: 1.3;
207
- overflow: hidden;
208
- text-overflow: ellipsis;
209
- white-space: normal;
210
- }
211
- .viber-carousel-static-buttons {
212
- display: flex;
213
- flex-direction: column;
214
- gap: $CAP_SPACE_04;
215
- }
216
- .viber-carousel-static-button {
217
- display: block;
218
- min-height: 1.5rem;
219
- border-radius: $CAP_SPACE_12;
220
- background: $CAP_PURPLE01;
221
- color: $CAP_WHITE;
222
- text-align: center;
223
- padding: 0.179rem $CAP_SPACE_08;
224
- white-space: normal;
225
- }
226
- .viber-carousel-static-button-secondary {
227
- color: $CAP_PURPLE01;
228
- background: transparent;
229
- border: none;
230
- box-shadow: none;
231
- }
232
- }
233
156
 
234
157
  }
235
158