From be59af940b2b78a07251b1373bc4c53305c86f7c Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Sat, 24 Nov 2018 00:24:02 -0500 Subject: [PATCH] update immutability test, though may need to be skipped for now --- .../samples/immutable-mutable/Nested.html | 6 ------ .../samples/immutable-mutable/_config.js | 18 ------------------ .../samples/immutable-mutable/main.html | 9 --------- .../samples/immutable-nested/Nested.html | 11 +++++++++++ .../samples/immutable-nested/_config.js | 13 ++++--------- 5 files changed, 15 insertions(+), 42 deletions(-) delete mode 100644 test/runtime/samples/immutable-mutable/Nested.html delete mode 100644 test/runtime/samples/immutable-mutable/_config.js delete mode 100644 test/runtime/samples/immutable-mutable/main.html diff --git a/test/runtime/samples/immutable-mutable/Nested.html b/test/runtime/samples/immutable-mutable/Nested.html deleted file mode 100644 index b68af94b89..0000000000 --- a/test/runtime/samples/immutable-mutable/Nested.html +++ /dev/null @@ -1,6 +0,0 @@ - - -

Called {count} times.

\ No newline at end of file diff --git a/test/runtime/samples/immutable-mutable/_config.js b/test/runtime/samples/immutable-mutable/_config.js deleted file mode 100644 index b1c0df1890..0000000000 --- a/test/runtime/samples/immutable-mutable/_config.js +++ /dev/null @@ -1,18 +0,0 @@ -export default { - immutable: true, - html: `

Called 0 times.

`, - - test(assert, component, target, window) { - var nested = component.nested; - nested.on('state', ({ changed }) => { - if (changed.foo) { - nested.set({ count: nested.get().count + 1 }); - } - }); - - assert.htmlEqual(target.innerHTML, `

Called 0 times.

`); - - nested.set({ foo: nested.get().foo }); - assert.htmlEqual(target.innerHTML, `

Called 1 times.

`); - } -}; diff --git a/test/runtime/samples/immutable-mutable/main.html b/test/runtime/samples/immutable-mutable/main.html deleted file mode 100644 index f036cbdfc3..0000000000 --- a/test/runtime/samples/immutable-mutable/main.html +++ /dev/null @@ -1,9 +0,0 @@ - - -
- -
diff --git a/test/runtime/samples/immutable-nested/Nested.html b/test/runtime/samples/immutable-nested/Nested.html index b68af94b89..402c615575 100644 --- a/test/runtime/samples/immutable-nested/Nested.html +++ b/test/runtime/samples/immutable-nested/Nested.html @@ -1,6 +1,17 @@

Called {count} times.

\ No newline at end of file diff --git a/test/runtime/samples/immutable-nested/_config.js b/test/runtime/samples/immutable-nested/_config.js index 0367e2e4c3..c0e280a72a 100644 --- a/test/runtime/samples/immutable-nested/_config.js +++ b/test/runtime/samples/immutable-nested/_config.js @@ -1,18 +1,13 @@ export default { immutable: true, - html: `

Called 0 times.

`, + html: `

Called 1 times.

`, test(assert, component, target, window) { var nested = component.nested; - nested.on('state', ({ changed }) => { - if (changed.foo) { - nested.set({ count: nested.get().count + 1 }); - } - }); - assert.htmlEqual(target.innerHTML, `

Called 0 times.

`); + assert.htmlEqual(target.innerHTML, `

Called 1 times.

`); - nested.set({ foo: nested.get().foo }); - assert.htmlEqual(target.innerHTML, `

Called 0 times.

`); + nested.foo = nested.foo; + assert.htmlEqual(target.innerHTML, `

Called 1 times.

`); } };