Skip to content

Commit

Permalink
add failing test for #5137
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Jun 1, 2022
1 parent b832423 commit 6c9e72e
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<p id="thing">this text is red</p>

<style>
p {
color: red;
}
</style>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<script context="module">
export async function load() {
return {
props: {
Thing: (await import('./_/Thing.svelte')).default
}
};
}
</script>

<script>
export let Thing;
</script>

<Thing />
9 changes: 9 additions & 0 deletions packages/kit/test/apps/basics/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1532,6 +1532,15 @@ test.describe.parallel('Load', () => {
);
}
});

test('CSS for dynamically imported components is reflected in server render', async ({
page
}) => {
await page.goto('/load/dynamic-import-styles');
expect(
await page.evaluate(() => getComputedStyle(document.querySelector('#thing')).color)
).toBe('rgb(255, 0, 0)');
});
});

test.describe.parallel('Method overrides', () => {
Expand Down

0 comments on commit 6c9e72e

Please sign in to comment.