]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
test: modify test case (#1703)
authorMonsterPi <43134418+MonsterPi13@users.noreply.github.com>
Fri, 17 Feb 2023 09:56:08 +0000 (17:56 +0800)
committerGitHub <noreply@github.com>
Fri, 17 Feb 2023 09:56:08 +0000 (10:56 +0100)
packages/router/__tests__/scrollBehavior.spec.ts

index 96b5dd1c124fc0117f84f4c0d64432e4a52ee0d9..3e1dd70ac7130352220e375636a69e68f66cbe5e 100644 (file)
@@ -70,7 +70,7 @@ describe('scrollBehavior', () => {
     it('scrolls to a position', () => {
       scrollToPosition({ left: 10, top: 100 })
       expect(getElementById).not.toHaveBeenCalled()
-      expect(getElementById).not.toHaveBeenCalled()
+      expect(querySelector).not.toHaveBeenCalled()
       expect(scrollTo).toHaveBeenCalledWith({
         left: 10,
         top: 100,
@@ -81,7 +81,7 @@ describe('scrollBehavior', () => {
     it('scrolls to a partial position top', () => {
       scrollToPosition({ top: 10 })
       expect(getElementById).not.toHaveBeenCalled()
-      expect(getElementById).not.toHaveBeenCalled()
+      expect(querySelector).not.toHaveBeenCalled()
       expect(scrollTo).toHaveBeenCalledWith({
         top: 10,
         behavior: undefined,
@@ -91,7 +91,7 @@ describe('scrollBehavior', () => {
     it('scrolls to a partial position left', () => {
       scrollToPosition({ left: 10 })
       expect(getElementById).not.toHaveBeenCalled()
-      expect(getElementById).not.toHaveBeenCalled()
+      expect(querySelector).not.toHaveBeenCalled()
       expect(scrollTo).toHaveBeenCalledWith({
         left: 10,
         behavior: undefined,