Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test CSS variable props #11

Open
janosh opened this issue Oct 26, 2022 · 0 comments
Open

Test CSS variable props #11

janosh opened this issue Oct 26, 2022 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@janosh
Copy link
Contributor

janosh commented Oct 26, 2022

Curious if anyone has looked into testing CSS variable props. This doesn't work (even with viteConfig.test.css set to true):

test(`CSS variables are applied`, () => {
  new Component({
    target: document.body,
    props: {
      '--custom-bg-color': `green`,
    },
  })
  const div = document.querySelector(`.some-class`)
  expect(getComputedStyle(div).backgroundColor).toBe(`green`)
})
@wd-David wd-David added the help wanted Extra attention is needed label Nov 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants