You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When using testing a component that uses useThemeUI the them object is initialized to null.
To Reproduce
Steps to reproduce the behavior:
Unit test a component that uses the useThemeUI hook.
Expected behavior
Without a ThemeProvider in the tree, the theme object returned from useThemeUI should return a default that includes expected properties so we don't need to use a ThemeProvider for every test.
The text was updated successfully, but these errors were encountered:
Wouldn't that be anti-pattern with how theme-ui works?
Not sure which test runner you are using, but with jest, you can easily add a "wrapper" to provide a theme for your unit tests (ideally the same theme that you use in your app)
Describe the bug
When using testing a component that uses
useThemeUI
the them object is initialized to null.To Reproduce
Steps to reproduce the behavior:
useThemeUI
hook.Expected behavior
Without a ThemeProvider in the tree, the theme object returned from
useThemeUI
should return a default that includes expected properties so we don't need to use a ThemeProvider for every test.The text was updated successfully, but these errors were encountered: