From cce4304e33c44c9c459b4738b944bfbfe3e8dd94 Mon Sep 17 00:00:00 2001 From: jannisvisser Date: Tue, 3 Dec 2024 12:41:27 +0100 Subject: [PATCH] fix: api test flash floods AB#31853 --- .../email/flash-flood/email-mwi-flash-flood.test.ts | 5 ++++- .../email/flash-flood/test-flash-flood-scenario.helper.ts | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/integration/email/flash-flood/email-mwi-flash-flood.test.ts b/tests/integration/email/flash-flood/email-mwi-flash-flood.test.ts index 772645313..40c4857c4 100644 --- a/tests/integration/email/flash-flood/email-mwi-flash-flood.test.ts +++ b/tests/integration/email/flash-flood/email-mwi-flash-flood.test.ts @@ -12,18 +12,21 @@ describe('Should send an email for mwi flash flood', () => { }); it('trigger', async () => { + const eventNames = ['Blantyre City', 'Karonga']; // Scneario contains also 'Rumphi' but as ongoing, for which no email is sent const result = await testFlashFloodScenario( FlashFloodsScenario.Trigger, countryCodeISO3, + eventNames, accessToken, ); expect(result).toBeTruthy(); - }); + }, 90000); //Increase timeout to 90 seconds, because mock takes long for this scenario it('no-trigger', async () => { const result = await testFlashFloodScenario( FlashFloodsScenario.NoTrigger, countryCodeISO3, + [], accessToken, ); expect(result).toBeTruthy(); diff --git a/tests/integration/email/flash-flood/test-flash-flood-scenario.helper.ts b/tests/integration/email/flash-flood/test-flash-flood-scenario.helper.ts index 65733a725..7c04e267c 100644 --- a/tests/integration/email/flash-flood/test-flash-flood-scenario.helper.ts +++ b/tests/integration/email/flash-flood/test-flash-flood-scenario.helper.ts @@ -11,9 +11,9 @@ import { export async function testFlashFloodScenario( scenario: FlashFloodsScenario, countryCodeISO3: string, + eventNames: string[] = [], accessToken: string, ): Promise { - const eventNames = ['Rumphi', 'Karonga']; const disasterTypeLabel = 'Flash Flood'; // DisasterType.FlashFloods does not match const mockResult = await mockFlashFlood(