MDL-76940 core_courseformat: Index refreshing when role switch

* Hidden sections and content should not visible to students when switching role
This commit is contained in:
Laurent David 2023-02-28 13:46:22 +01:00
parent 556208417d
commit 8f3d9e291e
2 changed files with 16 additions and 0 deletions

View file

@ -297,3 +297,14 @@ Feature: Course index depending on role
| large | be | Close | not be | Open | be |
| tablet | not be | Open | not be | Open | not be |
| mobile | not be | Open | not be | Open | not be |
@javascript
Scenario: Course index is refreshed when we change role.
When I am on the "C1" "Course" page logged in as "teacher1"
And I turn editing mode on
And I hide section "1"
And I turn editing mode off
And I should see "Topic 1" in the "courseindex-content" "region"
And I follow "Switch role to..." in the user menu
And I press "Student"
Then I should not see "Topic 1" in the "courseindex-content" "region"