Skip to content

Commit

Permalink
fix some projection tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Varixo committed Aug 10, 2024
1 parent a14dc9f commit 66185ea
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions packages/qwik/src/core/v2/shared/shared-serialization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1427,6 +1427,8 @@ export const canSerialize2 = (value: any): boolean => {
return true;
} else if (isPromise(value)) {
return true;
} else if (isJSXNode(value)) {
return true;
}
} else if (typeof value === 'function') {
if (isQrl(value) || isQwikComponent(value)) {
Expand Down
12 changes: 7 additions & 5 deletions packages/qwik/src/core/v2/tests/projection.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,18 @@ describe.each([
{ render: ssrRenderToDom }, //
{ render: domRender }, //
])('$render.name: projection', ({ render }) => {
it.only('should render basic projection', async () => {
it('should render basic projection', async () => {
const Child = component$(() => {
return (
<div>
<Slot name="shai">misko</Slot>
<Slot>misko</Slot>
</div>
);
});
const Parent = component$(() => {
return (
<Child>
<b q:slot="shai">parent-content</b>
<b>parent-content</b>
</Child>
);
});
Expand All @@ -62,7 +62,9 @@ describe.each([
<Component>
<Component>
<div>
<Projection>parent-content</Projection>
<Projection>
<b>parent-content</b>
</Projection>
</div>
</Component>
</Component>
Expand Down Expand Up @@ -619,7 +621,7 @@ describe.each([
);
});

const { vNode, document } = await render(<Parent />, { debug });
const { vNode, document } = await render(<Parent />, { debug: DEBUG });
expect(vNode).toMatchVDOM(
<Component>
<Fragment>
Expand Down

0 comments on commit 66185ea

Please sign in to comment.