Skip to content

Commit 1153e62

Browse files
@W-19143871 Email Footer Marketing Consent capture. Return immediately if feature is not enabled.
1 parent 09cd250 commit 1153e62

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

packages/template-retail-react-app/app/components/subscription/hooks/use-email-subscription.test.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ describe('useEmailSubscription', () => {
612612
expect(mockUpdateSubscriptions).not.toHaveBeenCalled()
613613
})
614614

615-
test('still validates email when feature is disabled', async () => {
615+
test('does not validate email when feature is disabled', async () => {
616616
const {result} = renderHook(() => useEmailSubscription({tag: 'email_capture'}), {
617617
wrapper: createWrapper()
618618
})
@@ -621,8 +621,7 @@ describe('useEmailSubscription', () => {
621621
await result.current.actions.submit()
622622
})
623623

624-
expect(result.current.state.feedback.type).toBe('error')
625-
expect(result.current.state.feedback.message).toBe('Enter a valid email address.')
624+
expect(result.current.state.feedback.type).toBe('success')
626625
expect(mockUpdateSubscriptions).not.toHaveBeenCalled()
627626
})
628627
})

packages/template-retail-react-app/app/hooks/use-marketing-consent.test.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,9 +1038,7 @@ describe('useMarketingConsent', () => {
10381038
test('isFeatureEnabled is false when value is string "true" (must be boolean)', () => {
10391039
useConfigurations.mockReturnValue({
10401040
data: {
1041-
configurations: [
1042-
{id: 'EnableConsentWithMarketingCloud', value: 'true'}
1043-
]
1041+
configurations: [{id: 'EnableConsentWithMarketingCloud', value: 'true'}]
10441042
}
10451043
})
10461044

0 commit comments

Comments
 (0)