MDL-68464 enrol_manual: Comment out buggy behat line
authorAndrew Nicols <andrew@nicols.co.uk>
Thu, 14 May 2020 03:10:57 +0000 (11:10 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Tue, 19 May 2020 04:37:21 +0000 (12:37 +0800)
commitabc83c40b5fc2ffd32967b2b84bc0f66d03bd250
treedcf17d459629c9addf1f1a4ee04ebd202bf385b0
parente0e7b19f9ce70d125f4f3956f23a295f57342d24
MDL-68464 enrol_manual: Comment out buggy behat line

This is commented out because auto-hidden toasts currently call `hide()`
and trigger the `bs.toast.hide` event immediately, and _then_ apply the
autohide delay.

Since we automatically add M.util.pending_js calls when we _start_ to
hide, and resolve them when the hide _finishes_, this means that we do:
- addToast called
- trigger `bs.toast.show` event
- add to pending_js
- [pending_js queue not empty - behat waits]
- message is shown in UI
- `hide()` called
- trigger `bs.toast.hide` event
- add to pending_js
- [pending_js queue not empty - behat waits]
- start autohide delay
- [pending_js queue not empty - behat waits]
- [pending_js queue not empty - behat waits]
- [pending_js queue not empty - behat waits]
- [pending_js queue not empty - behat waits]
- end autohide delay
- remove message (no longer present in DOM)
- trigger `bs.toast.hidden` event
- resolve pending_js
- [pending_js queue empty - behat stops waiting]
- Behat runs next step: And I should see "1 enrolled users"
-- Step fails beacuse the message has been shown, and has then been removed

The conversation should have been:
- addToast called
- trigger `bs.toast.show` event
- add to pending_js
- [pending_js queue not empty - behat waits]
- message is shown in UI
- start autohide delay
- trigger `bs.toast.shown` event
- resolve pending_js
- [pending_js queue empty - behat stops waiting]
- Behat runs next step: And I should see "1 enrolled users"
-- Step passes
- autohide delay ends and calls `hide()`
- trigger bs.toast.hide event
- add to pending_js
- [behat waits]
- end autohide delay
- remove message (no longer present in DOM)
- trigger `bs.toast.hidden` event
- resolve pending_js
- [pending_js queue empty - behat stops waiting]
- Behat run continues

See MDL-67386 for futher information.
enrol/manual/tests/behat/quickenrolment.feature