Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

Commit

Permalink
test(*): global and root are written at the same time.
Browse files Browse the repository at this point in the history
  • Loading branch information
refirst11 committed Oct 23, 2024
1 parent 566bfde commit 38a0210
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
10 changes: 10 additions & 0 deletions e2e/site/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ const css = cssx.create({
},
});

cssx.global({
h1: {
color: 'cyan',
},
});

cssx.root({
'--color-skyblue': 'skyblue',
});

export default function Home() {
return (
<main>
Expand Down
6 changes: 0 additions & 6 deletions e2e/site/component/style-create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@ const css = cssx.create({
},
});

cssx.global({
h1: {
color: 'aqua',
},
});

export function E2ETest() {
return (
<div className={css.e2e} data-testid="e2e-test-div">
Expand Down
4 changes: 4 additions & 0 deletions test/compiler-integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@ test('CSS compilation logs contain expected output', async () => {
expect(stdout).toContain('color: pink;');
expect(stdout).toContain('@media (max-width: 1024px)');
expect(stdout).toContain('color: aqua;');
// It will also be compiled if global and root are written at the same time.
expect(stdout).toContain('Generating global static css');
expect(stdout).toContain('color: cyan');
expect(stdout).toContain('--color-skyblue: skyblue');
}, 15000);

0 comments on commit 38a0210

Please sign in to comment.