Skip to content

Commit

Permalink
Fix 2018 not found in behat tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dpalou committed Jan 9, 2024
1 parent d67bff4 commit d4d7cc8
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tests/behat/checklist_dates.feature
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ Feature: I can add dates to a checklist and they appear in the calendar.
| duetimedisable | 0 |
| duetime[day] | 25 |
| duetime[month] | March |
| duetime[year] | 2025 |
| duetime[year] | 2034 |
And I press "Add"
# A date in the past.
And I set the following fields to these values:
| displaytext | Another list item |
| duetimedisable | 0 |
| duetime[day] | 18 |
| duetime[month] | June |
| duetime[year] | 2018 |
| duetime[year] | 2023 |
And I press "Add"
# No date for the last item.
And I set the following fields to these values:
Expand All @@ -47,31 +47,31 @@ Feature: I can add dates to a checklist and they appear in the calendar.

Scenario: When I add dates to items, they appear to the student.
When I am on the "Test checklist" "checklist activity" page logged in as "student1"
Then I should see "25 March 2025" in the "The first list item" "list_item"
Then I should see "25 March 2034" in the "The first list item" "list_item"
And ".checklist-itemdue" "css_element" should exist in the "The first list item" "list_item"
And I should see "18 June 2018" in the "Another list item" "list_item"
And I should see "18 June 2023" in the "Another list item" "list_item"
And ".checklist-itemoverdue" "css_element" should exist in the "Another list item" "list_item"

Scenario: When I add dates to items they appear in the course calendar.
When I log in as "student1"
And I visit the calendar for course "C1" showing date "25 March 2025"
And I visit the calendar for course "C1" showing date "25 March 2034"
Then I should see "The first list item"
And I should not see "Another list item"
And I should not see "Third list item"
When I visit the calendar for course "C1" showing date "18 June 2018"
When I visit the calendar for course "C1" showing date "18 June 2023"
Then I should see "Another list item"
And I should not see "The first list item"
And I should not see "Third list item"

Scenario: When I disable the 'add due dates to calendar' feature, dates should not appear in the calendar.
Given I am on the "Test checklist" "checklist activity" page logged in as "teacher1"
# Workaround for differences between M3.9 "Edit settings" and M4.0 "Settings".
And I navigate to "ettings" in current page administration
And I navigate to "Settings" in current page administration
And I set the field "Add due dates to calendar" to "No"
And I press "Save and return to course"
And I log out
When I log in as "student1"
And I visit the calendar for course "C1" showing date "25 March 2025"
And I visit the calendar for course "C1" showing date "25 March 2034"
Then I should not see "The first list item"
When I visit the calendar for course "C1" showing date "18 June 2018"
When I visit the calendar for course "C1" showing date "18 June 2023"
Then I should not see "Another list item"

0 comments on commit d4d7cc8

Please sign in to comment.