ALKASJDFALSKDFJ the test passes

pull/16762/head
S. Elliott Johnson 6 days ago
parent d4bd8e320b
commit 26d6613bfc

@ -131,10 +131,10 @@ export function child(node, is_text) {
/**
* Don't mark this as side-effect-free, hydration needs to walk all nodes
* @param {DocumentFragment | TemplateNode[]} fragment
* @param {boolean} is_text
* @param {boolean} [is_text]
* @returns {Node | null}
*/
export function first_child(fragment, is_text) {
export function first_child(fragment, is_text = false) {
if (!hydrating) {
// when not hydrating, `fragment` is a `DocumentFragment` (the result of calling `open_frag`)
var first = /** @type {DocumentFragment} */ (get_first_child(/** @type {Node} */ (fragment)));

@ -4,6 +4,7 @@ import { DEV } from 'esm-env';
import {
clear_text_content,
create_text,
first_child,
get_first_child,
get_next_sibling,
init_operations
@ -28,7 +29,7 @@ import {
import { reset_head_anchor } from './dom/blocks/svelte-head.js';
import * as w from './warnings.js';
import * as e from './errors.js';
import { assign_nodes } from './dom/template.js';
import { append, assign_nodes, comment } from './dom/template.js';
import { is_passive_event } from '../../utils.js';
import { COMMENT_NODE } from './constants.js';
import { boundary } from './dom/blocks/boundary.js';
@ -219,8 +220,8 @@ function _mount(Component, { target, anchor, props = {}, events, context, intro
var unmount = component_root(() => {
var anchor_node = anchor ?? target.appendChild(create_text());
boundary(anchor_node, {}, (anchor_node) =>
branch(() => {
branch(() => {
boundary(/** @type {TemplateNode} */ (anchor_node), { pending: () => {} }, (anchor_node) => {
if (context) {
push({});
var ctx = /** @type {ComponentContext} */ (component_context);
@ -248,8 +249,8 @@ function _mount(Component, { target, anchor, props = {}, events, context, intro
if (context) {
pop();
}
})
);
});
});
return () => {
for (var event_name of registered_events) {

@ -1,20 +0,0 @@
import { settled } from 'svelte';
import { ok, test } from '../../test';
export default test({
skip_mode: ['hydrate', 'server'],
html: `
<p>hello</p>
`,
async test({ assert, target }) {
const p = target.querySelector('p');
ok(p);
assert.htmlEqual(p.outerHTML, '<p>Loading...</p>');
const p2 = target.querySelector('p');
ok(p2);
assert.htmlEqual(p2.outerHTML, '<p>hello</p>');
}
});

@ -1,7 +0,0 @@
<svelte:boundary>
<p>{await Promise.resolve('hello')}</p>
{#snippet pending()}
<p>Loading...</p>
{/snippet}
</svelte:boundary>

@ -0,0 +1,15 @@
import { tick } from 'svelte';
import { ok, test } from '../../test';
export default test({
ssrHtml: '<p>hello</p>',
html: '',
async test({ assert, target }) {
await tick();
const p = target.querySelector('p');
ok(p);
assert.htmlEqual(p.outerHTML, '<p>hello</p>');
}
});
Loading…
Cancel
Save