Skip to content

Commit

Permalink
tests: render a theme upon using its className
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathantneal committed Aug 23, 2021
1 parent f75e0a8 commit 974c588
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion packages/core/tests/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,21 @@ describe('Theme', () => {
`}`
)
}
}) // prettier-ignore
})

test('theme.className injects the theme', () => {
const { getCssText, createTheme } = createStitches()

const theme = createTheme({
colors: {
blue: '#0000ff',
}
})

expect(getCssText()).toBe(``)

void theme.className

expect(getCssText()).toBe(`--sxs{--sxs:0 t-gpVVQE}@media{.t-gpVVQE{--colors-blue:#0000ff}}`)
})
})

0 comments on commit 974c588

Please sign in to comment.