From 5aaf5d99d7ef09c64f38f3d905aa77ab285ae922 Mon Sep 17 00:00:00 2001 From: Simey Lameze Date: Wed, 3 Jul 2019 13:21:54 +0800 Subject: [PATCH] MDL-65958 calendar: cover students default event type visibility --- calendar/tests/behat/calendar.feature | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/calendar/tests/behat/calendar.feature b/calendar/tests/behat/calendar.feature index 7785546402d..27f8adf90c8 100644 --- a/calendar/tests/behat/calendar.feature +++ b/calendar/tests/behat/calendar.feature @@ -219,3 +219,25 @@ Feature: Perform basic calendar functionality And I should see "Course 2" in the ".form-autocomplete-suggestions" "css_element" And I should see "Course 3" in the ".form-autocomplete-suggestions" "css_element" + @javascript + Scenario: Students can only see user event type by default. + Given I log in as "student1" + And I am viewing site calendar + When I click on "New event" "button" + Then I should see "User" in the "div#fitem_id_staticeventtype" "css_element" + And I am on "Course 1" course homepage + And I follow "This month" + When I click on "New event" "button" + Then I should see "User" in the "div#fitem_id_staticeventtype" "css_element" + And I click on "Close" "button" + And I log out + Given I log in as "admin" + And I navigate to "Appearance > Calendar" in site administration + And I set the field "Admins see all" to "1" + And I press "Save changes" + And I log out + Given I log in as "student1" + And I am on "Course 1" course homepage + And I follow "This month" + When I click on "New event" "button" + Then I should see "User" in the "div#fitem_id_staticeventtype" "css_element"