chore: fix and migrate unit tests to vitest

This commit is contained in:
Christian Andolf
2025-06-27 13:35:41 +02:00
parent a91c28096d
commit ff40ef72c4
26 changed files with 818 additions and 2835 deletions

View File

@@ -1,4 +1,4 @@
import { describe, expect, it } from "@jest/globals"
import { describe, expect, it } from "vitest"
import { getGroupedOpeningHours } from "./utils"
@@ -7,7 +7,7 @@ import type { IntlShape } from "react-intl"
// Mock IntlShape for testing
const mockIntl = {
formatMessage: ({ id }: { id: string }) => {
formatMessage: ({ defaultMessage }: { defaultMessage: string }) => {
const messages: Record<string, string> = {
Monday: "Monday",
Tuesday: "Tuesday",
@@ -19,7 +19,7 @@ const mockIntl = {
Closed: "Closed",
"Always open": "Always open",
}
return messages[id] || id
return messages[defaultMessage] || defaultMessage
},
} as IntlShape