8000 make tests pass · TonyXY/vue@966c3c9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 966c3c9

Browse files
committed
make tests pass
1 parent 5d06a42 commit 966c3c9

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

test/unit/specs/compiler/compile_spec.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ if (_.inBrowser) {
2424
_teardown: directiveTeardown
2525
})
2626
},
27-
$set: jasmine.createSpy('vm.$set'),
2827
$eval: function (value) {
2928
return data[value]
3029
},
@@ -203,13 +202,13 @@ if (_.inBrowser) {
203202
expect(args[2].parentPath).toBe('this._applyFilters(a,null,[{"name":"filter"}],false)')
204203
expect(args[2].mode).toBe(bindingModes.ONE_WAY)
205204
expect(args[3]).toBe(def)
206-
// literal and one time should've called vm.$set
205+
// literal and one time should've been set on the _data
207206
// and numbers should be casted
208-
expect(vm.$set.calls.count()).toBe(4)
209-
expect(vm.$set).toHaveBeenCalledWith('a', 1)
210-
expect(vm.$set).toHaveBeenCalledWith('someOtherAttr', 2)
211-
expect(vm.$set).toHaveBeenCalledWith('onetime', 'from parent: a')
212-
expect(vm.$set).toHaveBeenCalledWith('booleanLiteral', 'from parent: true')
207+
expect(Object.keys(vm._data).length).toBe(4)
208+
expect(vm._data.a).toBe(1)
209+
expect(vm._data.someOtherAttr).toBe(2)
210+
expect(vm._data.onetime).toBe('from parent: a')
211+
expect(vm._data.booleanLiteral).toBe('from parent: true')
213212
// camelCase should've warn
214213
expect(hasWarned(_, 'using camelCase')).toBe(true)
215214
})
@@ -223,7 +222,7 @@ if (_.inBrowser) {
223222
el.setAttribute('b', '{{hi}}')
224223
compiler.compileAndLinkProps(vm, el, ['a', 'b'])
225224
expect(vm._bindDir.calls.count()).toBe(0)
226-
expect(vm.$set).toHaveBeenCalledWith('a', 'hi')
225+
expect(vm._data.a).toBe('hi')
227226
expect(hasWarned(_, 'Cannot bind dynamic prop on a root')).toBe(true)
228227
// restore parent mock
229228
vm.$parent = parent

test/unit/specs/directives/component_spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ if (_.inBrowser) {
405405
var vm = new Vue({
406406
el: el
407407
})
408-
expect(hasWarned(_, 'already mounted instance')).toBe(true)
408+
expect(hasWarned(_, 'Do not create a component that only contains a single other component')).toBe(true)
409409
})
410410

411411
})

0 commit comments

Comments
 (0)
0