From d54dc6a7f10d7adf1095402b47a3c6b1a4bad410 Mon Sep 17 00:00:00 2001 From: shinyaigeek Date: Fri, 27 Aug 2021 23:33:53 +0900 Subject: [PATCH] [chore] add test for handling undefined select value with spread --- .../Select.svelte | 12 ++++++++++++ .../spread-element-select-value-undefined/_config.js | 11 +++++++++++ .../main.svelte | 11 +++++++++++ 3 files changed, 34 insertions(+) create mode 100644 test/runtime/samples/spread-element-select-value-undefined/Select.svelte create mode 100644 test/runtime/samples/spread-element-select-value-undefined/_config.js create mode 100644 test/runtime/samples/spread-element-select-value-undefined/main.svelte diff --git a/test/runtime/samples/spread-element-select-value-undefined/Select.svelte b/test/runtime/samples/spread-element-select-value-undefined/Select.svelte new file mode 100644 index 0000000000..6f5dadf001 --- /dev/null +++ b/test/runtime/samples/spread-element-select-value-undefined/Select.svelte @@ -0,0 +1,12 @@ + + + +

{label}

diff --git a/test/runtime/samples/spread-element-select-value-undefined/_config.js b/test/runtime/samples/spread-element-select-value-undefined/_config.js new file mode 100644 index 0000000000..59cf59d662 --- /dev/null +++ b/test/runtime/samples/spread-element-select-value-undefined/_config.js @@ -0,0 +1,11 @@ +export default { + async test({ assert, component, target, window }) { + const select = target.querySelector('select'); + + assert.equal(select.value, '1'); + + component.label = 'hoge'; + + assert.equal(select.value, '1'); + } +}; diff --git a/test/runtime/samples/spread-element-select-value-undefined/main.svelte b/test/runtime/samples/spread-element-select-value-undefined/main.svelte new file mode 100644 index 0000000000..57a2e3cf3e --- /dev/null +++ b/test/runtime/samples/spread-element-select-value-undefined/main.svelte @@ -0,0 +1,11 @@ + + +