spec: Add timer to helpDialogSpec

This fixes some failing tests when upgrading to jQuery 3.5.

refs FOO-4260
flag=none

Test Plan:
- Jenkins Passes

[skip-crystalball]

Change-Id: I75674c4fae4cd51bd9e0370bf5c303bece6ec083
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/342411
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Angela Gomba <angela.gomba@instructure.com>
Product-Review: Angela Gomba <angela.gomba@instructure.com>
Reviewed-by: Michael Hulse <michael.hulse@instructure.com>
This commit is contained in:
Angela Gomba 2024-03-07 17:00:33 -05:00
parent dee6568ddc
commit 36214ae403
1 changed files with 3 additions and 0 deletions

View File

@ -28,12 +28,14 @@ QUnit.module('HelpDialog', {
setup() {
fakeENV.setup({help_link_name: 'Links'})
helpDialog.animateDuration = 0
this.clock = sinon.useFakeTimers()
this.server = sinon.fakeServer.create()
this.server.respondWith('/help_links', '[]')
return this.server.respondWith('/api/v1/courses.json', '[]')
},
teardown() {
fakeENV.teardown()
this.clock.restore()
this.server.restore()
// if we don't close it after each test, subsequent tests get messed up.
@ -69,6 +71,7 @@ test('teacher feedback', function () {
test('focus management', function () {
helpDialog.open()
this.server.respond()
this.clock.tick(1)
helpDialog.switchTo('#create_ticket')
equal(document.activeElement, helpDialog.$dialog.find('#error_subject')[0], 'focuses first input')
ok(