From 2453bf948ee0b50b5809a1e4342a4f10c5730f19 Mon Sep 17 00:00:00 2001 From: Mathias Picker Date: Sat, 9 Jul 2022 19:49:16 +0200 Subject: [PATCH] updated test to create crazy value on runtime instead --- .../_config.js | 11 ----------- .../main.svelte | 1 - .../input-crazy-value-attribute/_config.js | 18 ++++++++++++++++++ .../input-crazy-value-attribute/main.svelte | 5 +++++ .../svg-crazy-attribute-value/_config.js | 10 ---------- .../svg-crazy-attribute-value/main.svelte | 1 - .../textarea-crazy-value-attribute/_config.js | 11 ----------- .../textarea-crazy-value-attribute/main.svelte | 1 - 8 files changed, 23 insertions(+), 35 deletions(-) delete mode 100644 test/runtime/samples/input-crazy-value-attribute.solo/_config.js delete mode 100644 test/runtime/samples/input-crazy-value-attribute.solo/main.svelte create mode 100644 test/runtime/samples/input-crazy-value-attribute/_config.js create mode 100644 test/runtime/samples/input-crazy-value-attribute/main.svelte delete mode 100644 test/runtime/samples/svg-crazy-attribute-value/_config.js delete mode 100644 test/runtime/samples/svg-crazy-attribute-value/main.svelte delete mode 100644 test/runtime/samples/textarea-crazy-value-attribute/_config.js delete mode 100644 test/runtime/samples/textarea-crazy-value-attribute/main.svelte diff --git a/test/runtime/samples/input-crazy-value-attribute.solo/_config.js b/test/runtime/samples/input-crazy-value-attribute.solo/_config.js deleted file mode 100644 index 31cbbd27d9..0000000000 --- a/test/runtime/samples/input-crazy-value-attribute.solo/_config.js +++ /dev/null @@ -1,11 +0,0 @@ -export default { - skip_if_hydrate_from_ssr: true, - skip_if_hydrate: true, - skip_if_ssr: true, - - test({ assert, target }) { - const input = target.querySelector('input'); - const one_million = 1000000 - assert.equal(input.value.length > one_million, true); - } -}; diff --git a/test/runtime/samples/input-crazy-value-attribute.solo/main.svelte b/test/runtime/samples/input-crazy-value-attribute.solo/main.svelte deleted file mode 100644 index a066c8e0ec..0000000000 --- a/test/runtime/samples/input-crazy-value-attribute.solo/main.svelte +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/test/runtime/samples/input-crazy-value-attribute/_config.js b/test/runtime/samples/input-crazy-value-attribute/_config.js new file mode 100644 index 0000000000..06094b62e9 --- /dev/null +++ b/test/runtime/samples/input-crazy-value-attribute/_config.js @@ -0,0 +1,18 @@ +const create_random_character = () => String.fromCharCode(Math.floor(Math.random() * (126 - 35)) + 35); +const one_million = 1000000; +const crazy_value = Array.from({ length: one_million }, create_random_character).join(''); + +export default { + skip_if_hydrate_from_ssr: true, + skip_if_hydrate: true, + skip_if_ssr: true, + + props: { + value: crazy_value + }, + + test({ assert, target }) { + const input = target.querySelector('input'); + assert.equal(input.value.length === one_million, true); + } +}; diff --git a/test/runtime/samples/input-crazy-value-attribute/main.svelte b/test/runtime/samples/input-crazy-value-attribute/main.svelte new file mode 100644 index 0000000000..5b01743119 --- /dev/null +++ b/test/runtime/samples/input-crazy-value-attribute/main.svelte @@ -0,0 +1,5 @@ + + + \ No newline at end of file diff --git a/test/runtime/samples/svg-crazy-attribute-value/_config.js b/test/runtime/samples/svg-crazy-attribute-value/_config.js deleted file mode 100644 index 91e0ca490b..0000000000 --- a/test/runtime/samples/svg-crazy-attribute-value/_config.js +++ /dev/null @@ -1,10 +0,0 @@ -export default { - skip_if_hydrate_from_ssr: true, - skip_if_hydrate: true, - skip_if_ssr: true, - - test({ assert, target }) { - const image = target.querySelector('image'); - assert.equal(image.tagName, 'IMAGE'); - } -}; diff --git a/test/runtime/samples/svg-crazy-attribute-value/main.svelte b/test/runtime/samples/svg-crazy-attribute-value/main.svelte deleted file mode 100644 index b476079db2..0000000000 --- a/test/runtime/samples/svg-crazy-attribute-value/main.svelte +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/test/runtime/samples/textarea-crazy-value-attribute/_config.js b/test/runtime/samples/textarea-crazy-value-attribute/_config.js deleted file mode 100644 index 11f0eef400..0000000000 --- a/test/runtime/samples/textarea-crazy-value-attribute/_config.js +++ /dev/null @@ -1,11 +0,0 @@ -export default { - skip_if_hydrate_from_ssr: true, - skip_if_hydrate: true, - skip_if_ssr: true, - - test({ assert, target }) { - const textarea = target.querySelector('textarea'); - const one_million = 1000000 - assert.equal(textarea.value.length > one_million, true); - } -}; diff --git a/test/runtime/samples/textarea-crazy-value-attribute/main.svelte b/test/runtime/samples/textarea-crazy-value-attribute/main.svelte deleted file mode 100644 index bf330bd852..0000000000 --- a/test/runtime/samples/textarea-crazy-value-attribute/main.svelte +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file