mirror of
https://github.com/chakra-ui/chakra-ui.git
synced 2026-09-14 16:43:45 +08:00
623e558ac2
* chore: init * feat: implement file upload component from ark * perf: replace split props * fix: split props * fix: tsconfig + eslint parser * chore: prefer empty slot styles * refactor: tokens and text styles * refactor: replace popover, tooltip and add hovercard * chore: add use client * chore: export styles * test: prefer tests from ark * refactor: file upload to recipe * refactor: use ark anatomy * docs: add changeset * chore: rm framer-motion example * refactor: env * refactor: dialog and drawer to use ark * fix(v3): update Button migration guide (#8397) Update Button migration guiide - change isDisabled to disabled - change colorScheme to colorPalette * chore: update box components * refactor: slider and range-slider -> ark * refactor: tsconfig and files * fix(deps): update dependency framer-motion to v11.0.25 (#8401) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * refactor: accordion * refactor: menu component * refactor: use pandacss valid prop * ci: update actions * refactor: test utils * refactor: vitest -> vite * refactor: as child + ark * fix: examples and website * feat: rm framer-motion * chore: pin ark versions * chore: update popover z-index * chore(deps): update react monorepo (#8472) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update commitlint monorepo (#8441) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore: update menu stories * chore: update slider example --------- Co-authored-by: Ivica Batinić <ivicabatinic123@gmail.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
43 lines
1.2 KiB
TypeScript
43 lines
1.2 KiB
TypeScript
import "@testing-library/jest-dom/vitest"
|
|
import { expect } from "vitest"
|
|
import "vitest-axe/extend-expect"
|
|
import * as matchers from "vitest-axe/matchers"
|
|
|
|
expect.extend(matchers)
|
|
|
|
const { getComputedStyle } = window
|
|
window.getComputedStyle = (elt) => getComputedStyle(elt)
|
|
window.Element.prototype.scrollTo = () => {}
|
|
window.scrollTo = () => {}
|
|
|
|
if (typeof window.matchMedia !== "function") {
|
|
Object.defineProperty(window, "matchMedia", {
|
|
enumerable: true,
|
|
configurable: true,
|
|
writable: true,
|
|
value: vi.fn().mockImplementation((query) => ({
|
|
matches: false,
|
|
media: query,
|
|
onchange: null,
|
|
addListener: vi.fn(), // Deprecated
|
|
removeListener: vi.fn(), // Deprecated
|
|
addEventListener: vi.fn(),
|
|
removeEventListener: vi.fn(),
|
|
dispatchEvent: vi.fn(),
|
|
})),
|
|
})
|
|
}
|
|
|
|
// Workaround https://github.com/jsdom/jsdom/issues/2524#issuecomment-897707183
|
|
global.TextEncoder = require("util").TextEncoder
|
|
|
|
global.ResizeObserver = vi.fn().mockImplementation(() => ({
|
|
observe: vi.fn(),
|
|
unobserve: vi.fn(),
|
|
disconnect: vi.fn(),
|
|
}))
|
|
|
|
window.HTMLCanvasElement.prototype.getContext = vi
|
|
.fn()
|
|
.mockImplementation(() => ({}))
|