MDL-68912 user: "Send a message" select all not working
authorRex Lorenzo <rex@teaching.ucla.edu>
Thu, 4 Jun 2020 06:02:02 +0000 (23:02 -0700)
committerRex Lorenzo <rex@teaching.ucla.edu>
Thu, 11 Jun 2020 00:53:53 +0000 (17:53 -0700)
user/amd/build/participants.min.js
user/amd/build/participants.min.js.map
user/amd/src/participants.js
user/tests/behat/bulk_message.feature [new file with mode: 0644]

index 53fd324..4e49ea2 100644 (file)
Binary files a/user/amd/build/participants.min.js and b/user/amd/build/participants.min.js differ
index a74b1ab..5938593 100644 (file)
Binary files a/user/amd/build/participants.min.js.map and b/user/amd/build/participants.min.js.map differ
index fb8b6dd..ebe72f6 100644 (file)
@@ -36,7 +36,7 @@ import {showAddNote, showSendMessage} from 'core_user/local/participants/bulkact
 
 const Selectors = {
     bulkActionSelect: "#formactionid",
-    bulkUserSelectedCheckBoxes: "input[data-togglegroup='participants-table']:checked",
+    bulkUserSelectedCheckBoxes: "input[data-togglegroup='participants-table'][data-toggle='slave']:checked",
     checkCountButton: "#checkall",
     showCountText: '[data-region="participant-count"]',
     showCountToggle: '[data-action="showcount"]',
diff --git a/user/tests/behat/bulk_message.feature b/user/tests/behat/bulk_message.feature
new file mode 100644 (file)
index 0000000..266124e
--- /dev/null
@@ -0,0 +1,32 @@
+@core @core_user @javascript
+Feature: Bulk message
+  In order to communicate with my students
+  As a teacher
+  I need to be able to send a message to all my students
+
+  Background:
+    Given the following "courses" exist:
+      | fullname | shortname | category | groupmode |
+      | Course 1 | C1        | 0        | 1         |
+    And the following "users" exist:
+      | username | firstname | lastname | email                |
+      | teacher1 | Teacher   | 1        | teacher@example.com  |
+      | student1 | Student   | 1        | student1@example.com |
+      | student2 | Student   | 2        | student2@example.com |
+    And the following "course enrolments" exist:
+      | user     | course | role           |
+      | teacher1 | C1     | editingteacher |
+      | student1 | C1     | student        |
+      | student2 | C1     | student        |
+
+  Scenario: Send a message to students from participants list
+    Given I log in as "teacher1"
+    And I am on "Course 1" course homepage
+    And I navigate to course participants
+    And I click on "Select all" "checkbox"
+    And I set the field "With selected users..." to "Send a message"
+    And I should see "Send message to 3 people"
+    And I set the following fields to these values:
+      | bulk-message | "Hello world!" |
+    When I press "Send message to 3 people"
+    Then I should see "Message sent to 3 people"