M8-R18: stabilize Mantine frontend tests
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { screen } from '@testing-library/react'
|
||||
import { useMantineEnv } from '@mantine/core'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { renderWithProviders } from './test-utils'
|
||||
|
||||
function MantineEnvironmentProbe() {
|
||||
return <output>{useMantineEnv()}</output>
|
||||
}
|
||||
|
||||
describe('renderWithProviders', () => {
|
||||
it('uses Mantine test environment', () => {
|
||||
renderWithProviders(<MantineEnvironmentProbe />)
|
||||
|
||||
expect(screen.getByText('test')).toBeInTheDocument()
|
||||
})
|
||||
})
|
||||
@@ -51,7 +51,7 @@ export function renderWithProviders(ui: ReactNode, options: RenderOptions = {})
|
||||
|
||||
function Wrapper() {
|
||||
return (
|
||||
<MantineProvider>
|
||||
<MantineProvider env="test">
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<MemoryRouter initialEntries={entries}>
|
||||
<Routes>
|
||||
|
||||
@@ -19,6 +19,9 @@ export default defineConfig({
|
||||
test: {
|
||||
environment: 'jsdom',
|
||||
globals: true,
|
||||
// Mantine-heavy UI tests allocate substantial jsdom resources. Keep the
|
||||
// worker pool bounded so concurrent CI jobs remain reliable.
|
||||
maxWorkers: 2,
|
||||
setupFiles: ['./src/test-setup.ts'],
|
||||
env: {
|
||||
// Lock the test timezone to UTC so that date-formatting assertions
|
||||
|
||||
Reference in New Issue
Block a user