Skip to content

Commit

Permalink
add failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Apr 20, 2021
1 parent 76832ed commit 74273a9
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
13 changes: 13 additions & 0 deletions packages/kit/test/apps/options/source/pages/css/__tests__.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import * as assert from 'uvu/assert';

/** @type {import('test').TestMaker} */
export default function (test, is_dev) {
test('loads styles', '/', async ({ page, clicknav }) => {
await clicknav('[href="/css"]');

assert.equal(
await page.evaluate(() => getComputedStyle(document.querySelector('h3')).color),
'rgb(255, 0, 0)'
);
});
}
7 changes: 7 additions & 0 deletions packages/kit/test/apps/options/source/pages/css/index.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<h3>I am styled</h3>

<style>
h3 {
color: red;
}
</style>
4 changes: 3 additions & 1 deletion packages/kit/test/apps/options/source/pages/index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
</script>

<h2>We're on index.svelte</h2>
<Message/>
<Message/>

<a href="/css">/css</a>

0 comments on commit 74273a9

Please sign in to comment.