mirror of https://github.com/lxndrblz/anatole.git

google-labs-jules[bot]
3 hours ago 255f0960a988b6571bc3ac15bdf100187150e3c3
test(theme-switcher): add unit tests for setThemeStyle function

- Added `jest` and `jest-environment-jsdom` to `devDependencies`
- Configured npm test script to use jest
- Created unit tests for `setThemeStyle` function located in `assets/js/anatole-theme-switcher.js`
- Mocks `window.matchMedia` for correct jsdom execution
- Tests changing the theme successfully updates `localStorage` and `document.documentElement`

Co-authored-by: KarelZe <12801659+KarelZe@users.noreply.github.com>
2 files modified
2 files added
5758 ■■■■■ changed files
assets/js/anatole-theme-switcher.test.js 55 ●●●●● diff | view | raw | blame | history
jest.config.js 3 ●●●●● diff | view | raw | blame | history
package-lock.json 5696 ●●●●● diff | view | raw | blame | history
package.json 4 ●●●●● diff | view | raw | blame | history