diff --git a/tests/integration/email/drought/email-uga-drought.test.ts b/tests/integration/email/drought/email-uga-drought.test.ts index efd4fd9f1..e07399b2a 100644 --- a/tests/integration/email/drought/email-uga-drought.test.ts +++ b/tests/integration/email/drought/email-uga-drought.test.ts @@ -58,7 +58,7 @@ describe('Should send an email for uga drought', () => { // Get all span elements with data-testid="event-name" and their lower case text content const eventNamesInEmail = Array.from( document.querySelectorAll('[data-testid="event-name"]'), - (el) => (el as Element).textContent.toLowerCase(), + (el) => (el as Element).textContent?.toLowerCase() ?? '', ); expect(eventNamesInEmail.length).toBe(nrOfEvents); diff --git a/tests/integration/email/floods/test-flood-scenario.helper.ts b/tests/integration/email/floods/test-flood-scenario.helper.ts index cde7afb2e..723b04610 100644 --- a/tests/integration/email/floods/test-flood-scenario.helper.ts +++ b/tests/integration/email/floods/test-flood-scenario.helper.ts @@ -24,7 +24,7 @@ export async function testFloodScenario( params: TestFloodScenarioDto, ): Promise { const { events, countryCodeISO3, accessToken } = params; - const disasterTypeLabel = 'Floods'; + const disasterTypeLabel = 'flood'; const mockResult = await mockFloods(scenario, countryCodeISO3, accessToken); // Act const response = await sendNotification( @@ -60,9 +60,11 @@ export async function testFloodScenario( // Check if there are elements with the desired text content for (const event of events) { const eventTitle = getEventTitle(disasterTypeLabel, event.eventName); + console.log('eventTitle: ', eventTitle); const hasEvent = eventNamesInEmail.some((eventName) => eventName.includes(eventTitle), ); + console.log('hasEvent: ', hasEvent); expect(hasEvent).toBe(true); }