diff --git a/packages/svelte/tests/runtime-runes/samples/hydratable-unused-keys-nesting-partial/_config.js b/packages/svelte/tests/runtime-runes/samples/hydratable-unused-keys-nesting-partial/_config.js new file mode 100644 index 0000000000..b1973a23c2 --- /dev/null +++ b/packages/svelte/tests/runtime-runes/samples/hydratable-unused-keys-nesting-partial/_config.js @@ -0,0 +1,27 @@ +import { tick } from 'svelte'; +import { test } from '../../test'; + +export default test({ + skip_no_async: true, + mode: ['async-server', 'hydrate'], + + server_props: { environment: 'server' }, + ssrHtml: + '
did you ever hear the tragedy of darth plagueis the wise?
Loading...
', + + test_ssr({ assert, warnings }) { + assert.strictEqual(warnings.length, 1); + // for some strange reason we trim the error code off the beginning of warnings so I can't actually assert it + assert.include(warnings[0], 'A `hydratable` value with key `partially_used`'); + }, + + async test({ assert, target }) { + // make sure the hydratable promise on the client has a chance to run and reject (it shouldn't, because the server data should be used) + await tick(); + + assert.htmlEqual( + target.innerHTML, + '
did you ever hear the tragedy of darth plagueis the wise?
no, sith daddy, please tell me
' + ); + } +}); diff --git a/packages/svelte/tests/runtime-runes/samples/hydratable-unused-keys-nesting-partial/main.svelte b/packages/svelte/tests/runtime-runes/samples/hydratable-unused-keys-nesting-partial/main.svelte new file mode 100644 index 0000000000..75723848b1 --- /dev/null +++ b/packages/svelte/tests/runtime-runes/samples/hydratable-unused-keys-nesting-partial/main.svelte @@ -0,0 +1,27 @@ + + +
{await partially_used_hydratable.used}
+ +
{await partially_used_hydratable.unused}
+ {#snippet pending()} +
Loading...
+ {/snippet} +