-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add e2e tests for pno form sent message list
- Loading branch information
1 parent
0ee18d1
commit e787242
Showing
3 changed files
with
106 additions
and
17 deletions.
There are no files selected for viewing
53 changes: 37 additions & 16 deletions
53
...src/main/resources/db/testdata/V666.29__Insert_dummy_prior_notification_sent_messages.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,39 @@ | ||
INSERT INTO public.prior_notification_sent_messages ( | ||
prior_notification_report_id, prior_notification_source, date_time_utc, communication_means, recipient_address_or_number, success, error_message, recipient_name, recipient_organization | ||
prior_notification_report_id, prior_notification_source, date_time_utc, communication_means, recipient_address_or_number, success, error_message, recipient_name, recipient_organization | ||
) VALUES | ||
( 'FAKE_OPERATION_103', 'LOGBOOK', NOW() AT TIME ZONE 'UTC' - INTERVAL '2 minutes', 'EMAIL', '[email protected]', TRUE, NULL, 'Unité 1', 'Douane'), | ||
( 'FAKE_OPERATION_106', 'LOGBOOK', NOW() AT TIME ZONE 'UTC' - INTERVAL '2 minutes', 'EMAIL', '[email protected]', TRUE, NULL, 'Unité 1', 'Douane'), | ||
( 'FAKE_OPERATION_106', 'LOGBOOK', NOW() AT TIME ZONE 'UTC' - INTERVAL '2 minutes', 'EMAIL', '[email protected]', TRUE, NULL, 'Unité 3', 'Gendarmerie'), | ||
( 'FAKE_OPERATION_108', 'LOGBOOK', NOW() AT TIME ZONE 'UTC' - INTERVAL '2 minutes', 'EMAIL', '[email protected]', FALSE, NULL, 'Unité 4', 'Gendarmerie'), | ||
( 'FAKE_OPERATION_108', 'LOGBOOK', NOW() AT TIME ZONE 'UTC' - INTERVAL '2 minutes', 'EMAIL', '[email protected]', FALSE, NULL, 'Unité 3', 'Gendarmerie'), | ||
( 'FAKE_OPERATION_110', 'LOGBOOK', NOW() AT TIME ZONE 'UTC' - INTERVAL '2 minutes', 'EMAIL', '[email protected]', TRUE, NULL, 'Unité 6', 'DDTM'), | ||
( 'FAKE_OPERATION_110', 'LOGBOOK', NOW() AT TIME ZONE 'UTC' - INTERVAL '2 minutes', 'EMAIL', '[email protected]', FALSE, NULL, 'Unité 7', 'Office Français de la Biodiversité'), | ||
( 'FAKE_OPERATION_110', 'LOGBOOK', NOW() AT TIME ZONE 'UTC' - INTERVAL '2 minutes', 'SMS', '+33123456789', FALSE, NULL, 'Unité 7', 'Office Français de la Biodiversité'), | ||
('00000000-0000-4000-0000-000000000003', 'MANUAL', NOW() AT TIME ZONE 'UTC' - INTERVAL '2 minutes', 'EMAIL', '[email protected]', TRUE, NULL, 'Unité 9', 'DDTM'), | ||
('00000000-0000-4000-0000-000000000003', 'MANUAL', NOW() AT TIME ZONE 'UTC' - INTERVAL '2 minutes', 'EMAIL', '[email protected]', FALSE, NULL, 'Unité 10', 'DIRM / DM'), | ||
('00000000-0000-4000-0000-000000000004', 'MANUAL', NOW() AT TIME ZONE 'UTC' - INTERVAL '2 minutes', 'EMAIL', '[email protected]', FALSE, NULL, 'Unité 11', 'DDTM'), | ||
('00000000-0000-4000-0000-000000000006', 'MANUAL', NOW() AT TIME ZONE 'UTC' - INTERVAL '2 minutes', 'EMAIL', '[email protected]', TRUE, NULL, 'Unité 11', 'DDTM'), | ||
('00000000-0000-4000-0000-000000000008', 'MANUAL', NOW() AT TIME ZONE 'UTC' - INTERVAL '2 minutes', 'EMAIL', '[email protected]', FALSE, NULL, 'Unité 12', 'DIRM / DM'), | ||
('00000000-0000-4000-0000-000000000010', 'MANUAL', NOW() AT TIME ZONE 'UTC' - INTERVAL '2 minutes', 'EMAIL', '[email protected]', TRUE, NULL, 'Unité 12', 'DIRM / DM'); | ||
|
||
( 'FAKE_OPERATION_103', 'LOGBOOK', NOW() AT TIME ZONE 'UTC' - INTERVAL '2.0 minutes', 'EMAIL', '[email protected]', TRUE, NULL, 'Unité 1', 'Douane'), | ||
|
||
( 'FAKE_OPERATION_106', 'LOGBOOK', NOW() AT TIME ZONE 'UTC' - INTERVAL '2.0 minutes', 'EMAIL', '[email protected]', TRUE, NULL, 'Unité 1', 'Douane'), | ||
( 'FAKE_OPERATION_106', 'LOGBOOK', NOW() AT TIME ZONE 'UTC' - INTERVAL '2.0 minutes', 'EMAIL', '[email protected]', TRUE, NULL, 'Unité 3', 'Gendarmerie'), | ||
|
||
( 'FAKE_OPERATION_108', 'LOGBOOK', NOW() AT TIME ZONE 'UTC' - INTERVAL '2.3 minutes', 'EMAIL', '[email protected]', FALSE, NULL, 'Unité 3', 'Gendarmerie'), | ||
( 'FAKE_OPERATION_108', 'LOGBOOK', NOW() AT TIME ZONE 'UTC' - INTERVAL '2.0 minutes', 'EMAIL', '[email protected]', FALSE, NULL, 'Unité 4', 'Gendarmerie'), | ||
( 'FAKE_OPERATION_108', 'LOGBOOK', NOW() AT TIME ZONE 'UTC' - INTERVAL '2.1 minutes', 'SMS', '+33123456789', FALSE, NULL, 'Unité 3', 'Gendarmerie'), | ||
( 'FAKE_OPERATION_108', 'LOGBOOK', NOW() AT TIME ZONE 'UTC' - INTERVAL '2.2 minutes', 'SMS', '+33987654321', FALSE, NULL, 'Unité 4', 'Gendarmerie'), | ||
|
||
( 'FAKE_OPERATION_108', 'LOGBOOK', NOW() AT TIME ZONE 'UTC' - INTERVAL '4.0 minutes', 'EMAIL', '[email protected]', FALSE, NULL, 'Unité 3', 'Gendarmerie'), | ||
( 'FAKE_OPERATION_108', 'LOGBOOK', NOW() AT TIME ZONE 'UTC' - INTERVAL '4.1 minutes', 'EMAIL', '[email protected]', TRUE, NULL, 'Unité 4', 'Gendarmerie'), | ||
( 'FAKE_OPERATION_108', 'LOGBOOK', NOW() AT TIME ZONE 'UTC' - INTERVAL '4.2 minutes', 'EMAIL', '[email protected]', FALSE, NULL, 'Unité 5', 'DDTM 40'), | ||
( 'FAKE_OPERATION_108', 'LOGBOOK', NOW() AT TIME ZONE 'UTC' - INTERVAL '4.3 minutes', 'SMS', '+33123456789', TRUE, NULL, 'Unité 3', 'Gendarmerie'), | ||
( 'FAKE_OPERATION_108', 'LOGBOOK', NOW() AT TIME ZONE 'UTC' - INTERVAL '4.4 minutes', 'SMS', '+33987654321', FALSE, NULL, 'Unité 4', 'Gendarmerie'), | ||
( 'FAKE_OPERATION_108', 'LOGBOOK', NOW() AT TIME ZONE 'UTC' - INTERVAL '4.5 minutes', 'SMS', '+33000000000', FALSE, NULL, 'Unité 5', 'DDTM 40'), | ||
|
||
( 'FAKE_OPERATION_108', 'LOGBOOK', NOW() AT TIME ZONE 'UTC' - INTERVAL '9.3 minutes', 'EMAIL', '[email protected]', TRUE, NULL, 'Unité 3', 'Gendarmerie'), | ||
( 'FAKE_OPERATION_108', 'LOGBOOK', NOW() AT TIME ZONE 'UTC' - INTERVAL '9.2 minutes', 'EMAIL', '[email protected]', TRUE, NULL, 'Unité 4', 'Gendarmerie'), | ||
( 'FAKE_OPERATION_108', 'LOGBOOK', NOW() AT TIME ZONE 'UTC' - INTERVAL '9.1 minutes', 'SMS', '+33123456789', TRUE, NULL, 'Unité 3', 'Gendarmerie'), | ||
( 'FAKE_OPERATION_108', 'LOGBOOK', NOW() AT TIME ZONE 'UTC' - INTERVAL '9.0 minutes', 'SMS', '+33987654321', TRUE, NULL, 'Unité 4', 'Gendarmerie'), | ||
|
||
( 'FAKE_OPERATION_110', 'LOGBOOK', NOW() AT TIME ZONE 'UTC' - INTERVAL '2.0 minutes', 'EMAIL', '[email protected]', TRUE, NULL, 'Unité 6', 'DDTM'), | ||
( 'FAKE_OPERATION_110', 'LOGBOOK', NOW() AT TIME ZONE 'UTC' - INTERVAL '2.0 minutes', 'EMAIL', '[email protected]', FALSE, NULL, 'Unité 7', 'Office Français de la Biodiversité'), | ||
( 'FAKE_OPERATION_110', 'LOGBOOK', NOW() AT TIME ZONE 'UTC' - INTERVAL '2.0 minutes', 'SMS', '+33111111111', FALSE, NULL, 'Unité 7', 'Office Français de la Biodiversité'), | ||
|
||
('00000000-0000-4000-0000-000000000003', 'MANUAL', NOW() AT TIME ZONE 'UTC' - INTERVAL '2.0 minutes', 'EMAIL', '[email protected]', TRUE, NULL, 'Unité 9', 'DDTM'), | ||
('00000000-0000-4000-0000-000000000003', 'MANUAL', NOW() AT TIME ZONE 'UTC' - INTERVAL '2.0 minutes', 'EMAIL', '[email protected]', FALSE, NULL, 'Unité 10', 'DIRM / DM'), | ||
|
||
('00000000-0000-4000-0000-000000000004', 'MANUAL', NOW() AT TIME ZONE 'UTC' - INTERVAL '2.0 minutes', 'EMAIL', '[email protected]', FALSE, NULL, 'Unité 11', 'DDTM'), | ||
|
||
('00000000-0000-4000-0000-000000000006', 'MANUAL', NOW() AT TIME ZONE 'UTC' - INTERVAL '2.0 minutes', 'EMAIL', '[email protected]', TRUE, NULL, 'Unité 11', 'DDTM'), | ||
|
||
('00000000-0000-4000-0000-000000000008', 'MANUAL', NOW() AT TIME ZONE 'UTC' - INTERVAL '2.0 minutes', 'EMAIL', '[email protected]', FALSE, NULL, 'Unité 12', 'DIRM / DM'), | ||
|
||
('00000000-0000-4000-0000-000000000010', 'MANUAL', NOW() AT TIME ZONE 'UTC' - INTERVAL '2.0 minutes', 'EMAIL', '[email protected]', TRUE, NULL, 'Unité 12', 'DIRM / DM'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
frontend/cypress/e2e/side_window/logbook_prior_notification_form/sent_message_list.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { editSideWindowPriorNotification } from './utils' | ||
|
||
context('Side Window > Logbook Prior Notification Form > Sent Message List', () => { | ||
it('Should display the expected list of subscribers and sent messages history', () => { | ||
editSideWindowPriorNotification(`CALAMARO`, 'FAKE_OPERATION_108') | ||
|
||
cy.intercept('GET', `/bff/v1/prior_notifications/FAKE_OPERATION_108/sent_messages`).as( | ||
'getPriorNotificationSentMessages' | ||
) | ||
|
||
cy.clickButton('Voir les détails de la diffusion du préavis') | ||
|
||
cy.wait('@getPriorNotificationSentMessages') | ||
|
||
cy.get('address').eq(0).contains('Unité 3 (Gendarmerie)') | ||
cy.get('address').eq(0).contains('[email protected]') | ||
cy.get('address').eq(0).contains('+33123456789') | ||
|
||
cy.get('address').eq(1).contains('Unité 4 (Gendarmerie)') | ||
cy.get('address').eq(1).contains('[email protected]') | ||
cy.get('address').eq(1).contains('+33987654321') | ||
|
||
cy.get('address').eq(2).contains('Unité 5 (DDTM 40)') | ||
cy.get('address').eq(2).contains('[email protected]') | ||
cy.get('address').eq(2).contains('+33000000000') | ||
|
||
cy.getDataCy('SentMessageList-historyItem') | ||
.eq(0) | ||
.contains( | ||
'Échec de la diffusion pour tous les contacts: [email protected], +33987654321, +33123456789, [email protected].' | ||
) | ||
|
||
cy.getDataCy('SentMessageList-historyItem') | ||
.eq(1) | ||
.contains( | ||
'Échec de la diffusion pour le(s) contact(s): +33000000000, +33987654321, [email protected], [email protected].' | ||
) | ||
|
||
cy.getDataCy('SentMessageList-historyItem').eq(2).contains('Préavis diffusé avec succès à tous les contacts.') | ||
}) | ||
}) |