Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-69086

Pending JS "closed.bs.alert" when closing a Bootstrap alert

    XMLWordPrintable

Details

    • MOODLE_310_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
    • MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
    • MDL-69086-master
    • Hide

      Behat should take care of this

      If you want to test manually:

      1. Open any Moodle page (login not required)
      2. Open browser developer tools => console
      3. Run the following:

        M.util.pending_js; // Should return an empty array => []
        require(['core/notification'], N => N.addNotification({message: "Close me!"}));
        M.util.pending_js; // Should return an empty array => []
        

        1. Confirm that a new notification appear in the body of the page
      4. Press the [x] button in the top-right of that notification
        1. Confirm that the notification was removed
        2. Confirm that the following code returns an empty array still:

          M.util.pending_js; // Should return an empty array => []
          

      Show
      Behat should take care of this If you want to test manually: Open any Moodle page (login not required) Open browser developer tools => console Run the following: M.util.pending_js; // Should return an empty array => [] require(['core/notification'], N => N.addNotification({message: "Close me!"})); M.util.pending_js; // Should return an empty array => [] Confirm that a new notification appear in the body of the page Press the [x] button in the top-right of that notification Confirm that the notification was removed Confirm that the following code returns an empty array still: M.util.pending_js; // Should return an empty array => []
    • International 4.0 - Sprint 1

    Description

      Hi there,

      I stumbled over this issue when I was adding a feature that uses Bootstrap alerts and my Behat test did always show the error

      Javascript code and/or AJAX requests are not ready after 10 seconds. There is a Javascript error or the code is extremely slow (closed.bs.alert). If you are using a slow machine, consider setting $CFG->behat_increasetimeout. (Exception)
      

      After several changes and tries, it seems that there's a problem with the core alert item. When you click it away (a Bootstrap alert that can be clicked away can be found on the "Purge caches" page (/admin/purgecaches.php) when you purged a cache), this function will be shown as pending js:

      No clue, if this might be related to the issues

      Best, Kathrin

      Attachments

        Issue Links

          Activity

            People

              dobedobedoh Andrew Lyons
              kosswa Kathrin Osswald
              Michael Hawkins Michael Hawkins
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              CiBoT CiBoT
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                13/Jul/20

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour, 25 minutes
                  1h 25m