Skip to content
Snippets Groups Projects
Verified Commit da7fbec8 authored by Alexandre Dias's avatar Alexandre Dias
Browse files

ISAICP-9399: Add tests.

parent 83c5f350
No related branches found
No related tags found
1 merge request!209Release 2.2.0
......@@ -7,7 +7,7 @@ resendrequest_delay: 3600
confirmation_lifetime: 0
confirmation_request:
subject: '[site:name] - Please validate your contact details'
body: '<p>Dear Interoperable Europe Portal user,</p><p>As owner/facilitator, we''re improving your privacy by replacing the publicly visible contact email information with a contact form that users/members can use to reach you.</p><p>Please confirm your email address <strong>[email-confirmer:confirmation-mail]</strong>, which is set in your contact information for the following:</p>[email-confirmer:confirmation-entities]<p><strong><a href="[email-confirmer:confirmation-url]">Confirm your e-mail address</a></strong><p><p>If the link doesn''''t work, just copy this URL to your browser:</p><p>[email-confirmer:confirmation-url]</p><p>If you do not validate your email within the next 5 days, you will not be able to receive any messages from users/members.</p><p>If you think this action is not clear or not due, please contact Portal Support at <a href="https://interoperable-europe.ec.europa.eu/contact" taget="_blank">https://interoperable-europe.ec.europa.eu/contact</a>.</p><p>Best regards,<br />The Interoperable Europe Portal Team</p>'
body: "<p>Dear Interoperable Europe Portal user,</p><p>As owner/facilitator, we're improving your privacy by replacing the publicly visible contact email information with a contact form that users/members can use to reach you.</p><p>Please confirm your email address <strong>[email-confirmer:confirmation-mail]</strong>, which is set in your contact information for the following:</p>[email-confirmer:confirmation-entities]<p><strong><a href=\"[email-confirmer:confirmation-url]\">Confirm your e-mail address</a></strong><p><p>If the link doesn''t work, just copy this URL to your browser:</p><p>[email-confirmer:confirmation-url]</p><p>If you do not validate your email within the next 5 days, you will not be able to receive any messages from users/members.</p><p>If you think this action is not clear or not due, please contact Portal Support at <a href=\"https://interoperable-europe.ec.europa.eu/contact\" taget=\"_blank\">https://interoperable-europe.ec.europa.eu/contact</a>.</p><p>Best regards,<br />The Interoperable Europe Portal Team</p>"
confirmation_response:
skip_confirmation_form: false
questions:
......
......@@ -125,4 +125,4 @@ status_canceled:
Kind regards,
The Portal Support Team
\ No newline at end of file
The Portal Support Team
......@@ -11,9 +11,9 @@ dependencies:
- node
- user
id: events_calendar
label: 'Events calendar'
label: 'Upcoming events'
module: views
description: ''
description: 'Upcoming events tiles'
tag: ''
base_table: node_field_data
base_field: nid
......
......@@ -11,11 +11,11 @@ Feature:
| Collection 2 |
| Collection 3 |
And event content:
| title | short title | field_paragraphs_body | collection | start date | end date | field_event_contact_email |
| Archived Event | Short | This is some dummy content like foo:bar. | Le Event Heureux | 2024-12-15T11:12:12 | 2024-12-15T11:12:12 | reach.me@example.com |
| Upcoming Event | Short | This is some dummy content like foo:bar. | Le Event Heureux | 2025-12-15T11:12:12 | 2025-12-15T11:12:12 | reach.me@example.com |
| Dummy Event 2 | Short | random text | Collection 2 | 2025-12-16T11:12:12 | 2025-12-16T11:12:12 | reach.me@example.com |
| Dummy Event 3 | Short | internal meeting | Collection 3 | 2025-12-17T11:12:12 | 2025-12-17T11:12:12 | reach.me@example.com |
| title | short title | field_paragraphs_body | collection | start date | end date | field_event_contact_email |
| Archived Event | Short | This is some dummy content like foo:bar. | Le Event Heureux | now -1 month | now -1 month | reach.me@example.com |
| Upcoming Event | Short | This is some dummy content like foo:bar. | Le Event Heureux | now +1 month | now +1 month +2 days | reach.me@example.com |
| Dummy Event 2 | Short | random text | Collection 2 | now +1 week | now +2 week | reach.me@example.com |
| Dummy Event 3 | Short | internal meeting | Collection 3 | now -1 week | now -1 week +1 day | reach.me@example.com |
Scenario: Test that Events calendar with a specific event is working correctly in monthly mode
When I am logged in as a facilitator of the "Le Event Heureux" collection
......@@ -37,14 +37,14 @@ Feature:
And I press "Publish"
Then I should be on the Page content page
Then I should see the calendar showing all days of current month
When I navigate the calendar to "2024-12-01" in month mode
When I navigate the calendar to "now -1 month" in month mode
Then I see the "Archived Event" showing in the Calendar
When I navigate the calendar to "2025-12-01" in month mode
Then I see the "Upcoming Event" showing in the Calendar
When I navigate the calendar to "now +1 month" in month mode
Then I see the "Dummy Event 2" showing in the Calendar
Then I see the "Dummy Event 3" showing in the Calendar
And I click "Upcoming Event"
Then I should be on the "Upcoming Event" content page
Then I not see the "Upcoming Event" showing in the Calendar
Then I not see the "Dummy Event 3" showing in the Calendar
And I click "Dummy Event 2"
Then I should be on the "Dummy Event 2" content page
Scenario: Test that Events calendar with a specific event is working correctly in weekly mode.
When I am logged in as a facilitator of the "Le Event Heureux" collection
......@@ -66,9 +66,49 @@ Feature:
And I press "Publish"
Then I should be on the "Page 2" content page
Then I should see the calendar showing all days of current week
When I navigate the calendar to "2024-12-15" in week mode
Then I see the "Archived Event" showing in the Calendar
When I navigate the calendar to "2025-12-15" in week mode
Then I see the "Upcoming Event" showing in the Calendar
And I click "Upcoming Event"
Then I should be on the "Upcoming Event" content page
When I navigate the calendar to "now -1 week" in week mode
Then I see the "Dummy Event 3" showing in the Calendar
When I navigate the calendar to "now +2 week" in week mode
Then I see the "Dummy Event 2" showing in the Calendar
And I click "Dummy Event 2"
Then I should be on the "Dummy Event 2" content page
Scenario: Test upcoming events page and paragraph.
Given event content:
| title | short title | field_paragraphs_body | collection | start date | end date | field_event_contact_email |
| Upcoming Event 1 | Short | This is some dummy content like foo:bar. | Le Event Heureux | now +2 day | now +5 day | reach.me@example.com |
| Upcoming Event 3 | Short | This is some dummy content like foo:bar. | Le Event Heureux | now -12 day | now -14 day | reach.me@example.com |
| Dummy Event 4 | Short | random text event | Collection 2 | now +1 week | now +1 week | reach.me@example.com |
| Dummy Event 5 | Short | infernal meeting | Collection 3 | now -1 week | now +2 week | reach.me@example.com |
When I am logged in as a facilitator of the "Le Event Heureux" collection
And I go to the "Le Event Heureux" collection
And I click "Add custom page" in the plus button menu
When I fill in the following:
| Title | Future events calendar |
| Abstract | Abstract future events calendar |
And I select "HR" from "Topic"
And I add a layout paragraph in the "Custom page body" form field with the following properties:
| layout | one column |
| Background theme | light |
| Extra classes | test-class |
And I click "Choose component"
And a modal should open
And I click "Events calendar"
And I select "Upcoming events" from "Block"
And I press "Save" in the "Modal buttons" region
And I press "Publish"
Then I should see the text "Future events calendar" in the "Page title" region
And I should see the text "Upcoming events"
And I should see the text "Check out our 2025 events"
And I should see the following tiles in the correct order:
| Upcoming Event 1 |
| Upcoming Event |
When I go to "/upcoming-events"
Then I should see the text "Upcoming events" in the "Page title" region
And I should see the text "Check out our 2025 events"
And I should see the following tiles in the correct order:
| Upcoming Event 1 |
| Dummy Event 2 |
| Dummy Event 4 |
| Upcoming Event |
......@@ -243,7 +243,25 @@ public function iSeeTheEventShowingInTheCalendar(string $event): void {
$eventElement = current(array_filter($elements, fn($element) => str_contains($element->getText(), $event))) ?: NULL;
if (!$eventElement) {
throw new \Exception(sprintf("Unable to locate an element containing the text '%s'.", $event));
throw new \Exception(sprintf("Event '%s' is NOT visible in the calendar as expected.", $event));
}
}
/**
* Verifies that a specific event is visible in the calendar.
*
* @param string $event
* The name of the event.
*
* @Then I not see the :event showing in the Calendar
*/
public function iNotSeeTheEventShowingInTheCalendar(string $event): void {
$page = $this->getSession()->getPage();
$elements = $page->findAll('css', '.calendar-view-day');
$eventElement = current(array_filter($elements, fn($element) => str_contains($element->getText(), $event))) || NULL;
if ($eventElement) {
throw new \Exception(sprintf("The event '%s' was found in the calendar, but it should NOT be visible.", $event));
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment