Parcourir la source

test: correcting existing test case (#5909)

Fix the location of the test case
lyhper il y a 8 ans
Parent
commit
00a3085628
1 fichiers modifiés avec 18 ajouts et 18 suppressions
  1. 18 18
      test/unit/features/global-api/set-delete.spec.js

+ 18 - 18
test/unit/features/global-api/set-delete.spec.js

@@ -52,6 +52,24 @@ describe('Global API: set/delete', () => {
         expect(vm.$el.innerHTML).toBe('')
         expect(vm.$el.innerHTML).toBe('')
       }).then(done)
       }).then(done)
     })
     })
+
+    it('be able to use string type index in array', done => {
+      const vm = new Vue({
+        template: '<div><p v-for="obj in lists">{{obj.name}}</p></div>',
+        data: {
+          lists: [
+            { name: 'A' },
+            { name: 'B' },
+            { name: 'C' }
+          ]
+        }
+      }).$mount()
+      expect(vm.$el.innerHTML).toBe('<p>A</p><p>B</p><p>C</p>')
+      Vue.set(vm.lists, '0', { name: 'D' })
+      waitForUpdate(() => {
+        expect(vm.$el.innerHTML).toBe('<p>D</p><p>B</p><p>C</p>')
+      }).then(done)
+    })
   })
   })
 
 
   describe('Vue.delete', () => {
   describe('Vue.delete', () => {
@@ -96,23 +114,5 @@ describe('Global API: set/delete', () => {
         expect(vm.$el.innerHTML).toBe('')
         expect(vm.$el.innerHTML).toBe('')
       }).then(done)
       }).then(done)
     })
     })
-
-    it('be able to use string type index in array', done => {
-      const vm = new Vue({
-        template: '<div><p v-for="obj in lists">{{obj.name}}</p></div>',
-        data: {
-          lists: [
-            { name: 'A' },
-            { name: 'B' },
-            { name: 'C' }
-          ]
-        }
-      }).$mount()
-      expect(vm.$el.innerHTML).toBe('<p>A</p><p>B</p><p>C</p>')
-      Vue.set(vm.lists, '0', { name: 'D' })
-      waitForUpdate(() => {
-        expect(vm.$el.innerHTML).toBe('<p>D</p><p>B</p><p>C</p>')
-      }).then(done)
-    })
   })
   })
 })
 })