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

@@ -0,0 +1,27 @@
import { render, type RenderOptions } from "@testing-library/react"
import React, { type ReactElement } from "react"
import { Lang } from "@scandic-hotels/common/constants/language"
import messages from "@/i18n/dictionaries/en.json"
import ClientIntlProvider from "@/i18n/Provider"
function AllTheProviders({ children }: { children: React.ReactNode }) {
return (
<ClientIntlProvider
defaultLocale={Lang.en}
locale={Lang.en}
messages={messages}
>
{children}
</ClientIntlProvider>
)
}
const customRender = (
ui: ReactElement,
options?: Omit<RenderOptions, "wrapper">
) => render(ui, { wrapper: AllTheProviders, ...options })
export * from "@testing-library/react"
export { customRender as render }