From 52de08b1e02b82e86473a376787f491995fbbeef Mon Sep 17 00:00:00 2001 From: Umang Galaiya Date: Sat, 13 Jul 2019 14:09:10 +0530 Subject: [PATCH] [Test] Add test for class directive with spread attributes --- .../_config.js | 22 +++++++++++++++++++ .../main.html | 1 + 2 files changed, 23 insertions(+) create mode 100644 test/runtime/samples/class-with-dynamic-attribute-and-spread/_config.js create mode 100644 test/runtime/samples/class-with-dynamic-attribute-and-spread/main.html diff --git a/test/runtime/samples/class-with-dynamic-attribute-and-spread/_config.js b/test/runtime/samples/class-with-dynamic-attribute-and-spread/_config.js new file mode 100644 index 0000000000..a99a9a9d1e --- /dev/null +++ b/test/runtime/samples/class-with-dynamic-attribute-and-spread/_config.js @@ -0,0 +1,22 @@ +export default { + data: { + myClass: 'one two', + attributes: { + role: 'button' + } + }, + html: `
`, + + test ( assert, component, target, window ) { + component.set({ + attributes: { + 'aria-label': 'Test' + }, + myClass: 'one' + }); + + assert.htmlEqual( target.innerHTML, ` +
+ ` ); + } +}; diff --git a/test/runtime/samples/class-with-dynamic-attribute-and-spread/main.html b/test/runtime/samples/class-with-dynamic-attribute-and-spread/main.html new file mode 100644 index 0000000000..b87c1c7b3c --- /dev/null +++ b/test/runtime/samples/class-with-dynamic-attribute-and-spread/main.html @@ -0,0 +1 @@ +