MDL-68409 behat: Fix tests from modal rewrite
authorAndrew Nicols <andrew@nicols.co.uk>
Mon, 20 Apr 2020 12:57:00 +0000 (20:57 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Mon, 4 May 2020 07:08:11 +0000 (15:08 +0800)
calendar/amd/build/crud.min.js
calendar/amd/build/crud.min.js.map
calendar/amd/build/modal_delete.min.js
calendar/amd/build/modal_delete.min.js.map
calendar/amd/src/crud.js
calendar/amd/src/modal_delete.js
mod/assign/feedback/editpdf/tests/behat/view_previous_annotations.feature
mod/assign/tests/behat/edit_previous_feedback.feature
tag/tests/behat/delete_tag.feature

index d44cd94..31d3420 100644 (file)
Binary files a/calendar/amd/build/crud.min.js and b/calendar/amd/build/crud.min.js differ
index c6e0e09..499e7b6 100644 (file)
Binary files a/calendar/amd/build/crud.min.js.map and b/calendar/amd/build/crud.min.js.map differ
index 184a283..77dbc02 100644 (file)
Binary files a/calendar/amd/build/modal_delete.min.js and b/calendar/amd/build/modal_delete.min.js differ
index 4a4c185..090c326 100644 (file)
Binary files a/calendar/amd/build/modal_delete.min.js.map and b/calendar/amd/build/modal_delete.min.js.map differ
index 7853a67..c18cb56 100644 (file)
@@ -63,6 +63,7 @@ function(
      * @return {Promise}
      */
     function confirmDeletion(eventId, eventTitle, eventCount) {
+        var pendingPromise = new Pending('core_calendar/crud:confirmDeletion');
         var deleteStrings = [
             {
                 key: 'deleteevent',
@@ -139,6 +140,11 @@ function(
 
             return deleteModal;
         })
+        .then(function(modal) {
+            pendingPromise.resolve();
+
+            return modal;
+        })
         .catch(Notification.exception);
 
         return finalPromise;
index 9541dec..e457761 100644 (file)
@@ -55,6 +55,8 @@ function(
      */
     var ModalDelete = function(root) {
         Modal.call(this, root);
+
+        this.setRemoveOnClose(true);
     };
 
     ModalDelete.TYPE = 'core_calendar-modal_delete';
index b593498..1b341ee 100644 (file)
@@ -56,7 +56,7 @@ Feature: In an assignment, teacher can view the feedback for a previous attempt.
     And I should see "The changes to the grade and feedback were saved"
     And I press "Ok"
     And I follow "View a different attempt"
-    And I click on "//div[contains(@class, 'moodle-dialogue-bd')]//label[2]" "xpath_element"
+    And I click on "Attempt 1" "radio" in the "View a different attempt" "dialogue"
     And I press "View"
     And I wait until the page is ready
     And I should see "You are editing the feedback for a previous attempt. This is attempt 1 out of 2."
index 007d4fd..add1bec 100644 (file)
@@ -60,7 +60,7 @@ Feature: In an assignment, teachers can edit feedback for a students previous su
     And I navigate to "View all submissions" in current page administration
     And I click on "Grade" "link" in the "Student 2" "table_row"
     And I click on "View a different attempt" "link"
-    And I click on "//div[contains(concat(' ', normalize-space(@class), ' '), ' confirmation-dialogue ')]//input[@value='0']" "xpath_element"
+    And I click on "Attempt 1" "radio" in the "View a different attempt" "dialogue"
     And I click on "View" "button"
     And I set the following fields to these values:
       | Grade | 50 |
index 5423604..18eb048 100644 (file)
@@ -53,7 +53,7 @@ Feature: Manager is able to delete tags
     And I follow "Default collection"
     And I click on "Delete" "link" in the "Turtle" "table_row"
     Then I should see "Are you sure you want to delete this tag?"
-    And I press "No"
+    And I click on "Cancel" "button" in the "Delete" "dialogue"
     And I should not see "Tag(s) deleted"
     And I should see "Turtle"
     And I click on "Delete" "link" in the "Dog" "table_row"
@@ -81,7 +81,7 @@ Feature: Manager is able to delete tags
       | Select tag Cat | 1 |
     And I press "Delete selected"
     And I should see "Are you sure you want to delete selected tags?"
-    And I press "No"
+    And I click on "Cancel" "button" in the "Delete" "dialogue"
     And I should not see "Tag(s) deleted"
     And I should see "Cat"
     And I set the following fields to these values: