From 70aa69949652183622e0b96637caf4d80e704b26 Mon Sep 17 00:00:00 2001 From: Umang Galaiya Date: Sun, 14 Jul 2019 20:49:18 +0530 Subject: [PATCH] [Test] Add test for class with spread attributes --- .../samples/class-with-spread/_config.js | 21 +++++++++++++++++++ .../samples/class-with-spread/main.svelte | 6 ++++++ 2 files changed, 27 insertions(+) create mode 100644 test/runtime/samples/class-with-spread/_config.js create mode 100644 test/runtime/samples/class-with-spread/main.svelte diff --git a/test/runtime/samples/class-with-spread/_config.js b/test/runtime/samples/class-with-spread/_config.js new file mode 100644 index 0000000000..d5233a5849 --- /dev/null +++ b/test/runtime/samples/class-with-spread/_config.js @@ -0,0 +1,21 @@ +export default { + props: { + myClass: 'one two', + attributes: { + role: 'button' + } + }, + + html: `
`, + + test({ assert, component, target, window }) { + component.myClass = 'one'; + component.attributes = { + 'aria-label': 'Test' + }; + + assert.htmlEqual(target.innerHTML, ` +
+ `); + } +}; diff --git a/test/runtime/samples/class-with-spread/main.svelte b/test/runtime/samples/class-with-spread/main.svelte new file mode 100644 index 0000000000..54d8088581 --- /dev/null +++ b/test/runtime/samples/class-with-spread/main.svelte @@ -0,0 +1,6 @@ + + +