mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
reduce tooltip delay for all tests
This commit is contained in:
@@ -12,9 +12,6 @@ vi.mock("@lingui/react", () => ({
|
|||||||
}))
|
}))
|
||||||
vi.mock("hooks/useActionButton")
|
vi.mock("hooks/useActionButton")
|
||||||
|
|
||||||
// reduce delay for faster tests
|
|
||||||
vi.mock("app/constants", () => ({ Constants: { tooltip: { delay: 10 } } }))
|
|
||||||
|
|
||||||
const label = "Test Label"
|
const label = "Test Label"
|
||||||
const icon = "Test Icon"
|
const icon = "Test Icon"
|
||||||
describe("ActionButton", () => {
|
describe("ActionButton", () => {
|
||||||
|
|||||||
@@ -1,6 +1,12 @@
|
|||||||
import "@testing-library/jest-dom"
|
import "@testing-library/jest-dom"
|
||||||
|
import { Constants } from "app/constants"
|
||||||
import { vi } from "vitest"
|
import { vi } from "vitest"
|
||||||
|
|
||||||
|
// reduce delay for faster tests
|
||||||
|
Constants.tooltip.delay = 10
|
||||||
|
|
||||||
|
// jsdom doesn't mock matchMedia
|
||||||
|
// https://stackoverflow.com/a/53449595/
|
||||||
Object.defineProperty(window, "matchMedia", {
|
Object.defineProperty(window, "matchMedia", {
|
||||||
writable: true,
|
writable: true,
|
||||||
value: vi.fn().mockImplementation(query => ({
|
value: vi.fn().mockImplementation(query => ({
|
||||||
|
|||||||
Reference in New Issue
Block a user