From a6539387f953085adb7b2e9c540c0d6f01f373f2 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Sat, 24 Nov 2018 22:29:44 -0500 Subject: [PATCH] fix test --- test/runtime/samples/lifecycle-events/_config.js | 5 +++-- test/runtime/samples/ondestroy-before-cleanup/Top.html | 6 +++--- test/runtime/samples/ondestroy-before-cleanup/_config.js | 6 +++++- test/runtime/samples/ondestroy-before-cleanup/container.js | 1 + test/runtime/samples/ondestroy-before-cleanup/main.html | 5 ++--- 5 files changed, 14 insertions(+), 9 deletions(-) create mode 100644 test/runtime/samples/ondestroy-before-cleanup/container.js diff --git a/test/runtime/samples/lifecycle-events/_config.js b/test/runtime/samples/lifecycle-events/_config.js index 77290d513b..53bc4c4d88 100644 --- a/test/runtime/samples/lifecycle-events/_config.js +++ b/test/runtime/samples/lifecycle-events/_config.js @@ -1,7 +1,8 @@ export default { test({ assert, component }) { - assert.deepEqual(component.events, ['mount']); + const { events } = component; + assert.deepEqual(events, ['mount']); component.$destroy(); - assert.deepEqual(component.events, ['mount', 'destroy']); + assert.deepEqual(events, ['mount', 'destroy']); } }; diff --git a/test/runtime/samples/ondestroy-before-cleanup/Top.html b/test/runtime/samples/ondestroy-before-cleanup/Top.html index 7a023b75b6..a0a3549ef4 100644 --- a/test/runtime/samples/ondestroy-before-cleanup/Top.html +++ b/test/runtime/samples/ondestroy-before-cleanup/Top.html @@ -1,11 +1,11 @@ diff --git a/test/runtime/samples/ondestroy-before-cleanup/_config.js b/test/runtime/samples/ondestroy-before-cleanup/_config.js index 78fec33169..e9721f24b0 100644 --- a/test/runtime/samples/ondestroy-before-cleanup/_config.js +++ b/test/runtime/samples/ondestroy-before-cleanup/_config.js @@ -1,9 +1,13 @@ +import container from './container.js'; + export default { test({ assert, component, target }) { + container.div = null; + const top = component.top; const div = target.querySelector('div'); component.visible = false; - assert.equal(top.refOnDestroy, div); + assert.equal(container.div, div); } }; \ No newline at end of file diff --git a/test/runtime/samples/ondestroy-before-cleanup/container.js b/test/runtime/samples/ondestroy-before-cleanup/container.js new file mode 100644 index 0000000000..7c645e42fb --- /dev/null +++ b/test/runtime/samples/ondestroy-before-cleanup/container.js @@ -0,0 +1 @@ +export default {}; \ No newline at end of file diff --git a/test/runtime/samples/ondestroy-before-cleanup/main.html b/test/runtime/samples/ondestroy-before-cleanup/main.html index e7758c98f6..15da7a5cba 100644 --- a/test/runtime/samples/ondestroy-before-cleanup/main.html +++ b/test/runtime/samples/ondestroy-before-cleanup/main.html @@ -1,8 +1,7 @@