|
|
@@ -349,4 +349,28 @@ describe('Options props', () => {
|
|
|
}).$mount()
|
|
|
expect(console.error.calls.count()).toBe(0)
|
|
|
})
|
|
|
+
|
|
|
+ // #3453
|
|
|
+ it('should not fire watcher on object/array props when parent re-renders', done => {
|
|
|
+ const spy = jasmine.createSpy()
|
|
|
+ const vm = new Vue({
|
|
|
+ data: {
|
|
|
+ arr: []
|
|
|
+ },
|
|
|
+ template: '<test :prop="arr">hi</test>',
|
|
|
+ components: {
|
|
|
+ test: {
|
|
|
+ props: ['prop'],
|
|
|
+ watch: {
|
|
|
+ prop: spy
|
|
|
+ },
|
|
|
+ template: '<div><slot></slot></div>'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).$mount()
|
|
|
+ vm.$forceUpdate()
|
|
|
+ waitForUpdate(() => {
|
|
|
+ expect(spy).not.toHaveBeenCalled()
|
|
|
+ }).then(done)
|
|
|
+ })
|
|
|
})
|