]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Standardization of `spyOn` usage (#36742)
authorJulien Déramond <julien.deramond@orange.com>
Fri, 15 Jul 2022 13:52:03 +0000 (15:52 +0200)
committerGitHub <noreply@github.com>
Fri, 15 Jul 2022 13:52:03 +0000 (16:52 +0300)
js/tests/unit/modal.spec.js

index 9e463d2be3bb1f73899f001ecf1d45bc8e915dc8..1bdf4e66ad89b8961b970520247cf2194cf65b86 100644 (file)
@@ -713,16 +713,16 @@ describe('Modal', () => {
         const dialogEl = modalEl.querySelector('.modal-dialog')
         const modal = new Modal(modalEl)
 
-        spyOn(modal, 'hide')
+        const spy = spyOn(modal, 'hide')
 
         modalEl.addEventListener('shown.bs.modal', () => {
           const mouseDown = createEvent('mousedown')
 
           dialogEl.dispatchEvent(mouseDown)
-          expect(modal.hide).not.toHaveBeenCalled()
+          expect(spy).not.toHaveBeenCalled()
 
           modalEl.dispatchEvent(mouseDown)
-          expect(modal.hide).toHaveBeenCalled()
+          expect(spy).toHaveBeenCalled()
           resolve()
         })