ThatAIguyA world of ideas

THE CONSCIOUSNESS ATLAS
Read. Experiment. Follow the evidence.

ConsciousnessLearn · Explore · Joseph Anady

Janady13/llms-txt-hub / apps/web/__tests__/utils/test-utils.helper.tsx

Source identity, revision, and recovered contents.

GitHub sourceSource text recovered

Source identity

FieldRecorded value
Source typeGitHub source
Original recordJanady13/llms-txt-hub / apps/web/__tests__/utils/test-utils.helper.tsx
DateNot specified in source
RepositoryJanady13/llms-txt-hub
Revisione0f4bf978d4df168369c7601d9c5f5ea89e84377
Branchmain
Path or archive memberapps/web/__tests__/utils/test-utils.helper.tsx
Original SHA-25648d8a157592ec24a912efeccee81a4e7af8c7e5674d6659e7569c52ec70a93fb
Git blob SHAda20a83ae08c23614acd04a42838dcb587223703
Reading-copy SHA-25648d8a157592ec24a912efeccee81a4e7af8c7e5674d6659e7569c52ec70a93fb

Original source ↗

Recovered source transcript

/** * Simplified test utilities */ import { type RenderResult, render } from '@testing-library/react' import userEvent from '@testing-library/user-event' import { type CustomRenderOptions, createTestQueryClient, TestProviders } from './test-providers' // Re-export mock factories export { createMockApiError, createMockApiResponse, createMockProject, createMockUser } from './mock-factories' export { createTestQueryClient, TestProviders } from './test-providers' /** * Custom render function with providers and user events * * @param ui - React component to render * @param options - Render options including custom providers * @returns Render result with user event utilities */ export function customRender( ui: React.ReactElement, options: CustomRenderOptions = {} ): RenderResult & { user: ReturnType<typeof userEvent.setup> } { const { user = null, isAuthenticated = false, theme = 'light', queryClient, wrapperProps = {}, ...renderOptions } = options const testQueryClient = queryClient || createTestQueryClient() // Mock auth context values are provided directly to ThemeProvider /** * Wrapper component that provides all necessary contexts for testing * * @param props - Component props including children * @returns React component with all providers */ function Wrapper({ children }: { children: React.ReactNode }) { return ( <TestProviders queryClient={testQueryClient} theme={theme} user={user} isAuthenticated={isAuthenticated} {...wrapperProps} > {children} </TestProviders> ) } const renderResult = render(ui, { wrapper: Wrapper, ...renderOptions }) const userEventInstance = userEvent.setup() return { ...renderResult, user: userEventInstance } } // Re-export specific RTL helpers (excluding render to avoid duplicate export) export { act, cleanup, findAllByAltText, findAllByDisplayValue, findAllByLabelText, findAllByPlaceholderText, findAllByRole, findAllByTestId, findAllByText, findAllByTitle, findByAltText, findByDisplayValue, findByLabelText, findByPlaceholderText, findByRole, findByTestId, findByText, findByTitle, fireEvent, getAllByAltText, getAllByDisplayValue, getAllByLabelText, getAllByPlaceholderText, getAllByRole, getAllByTestId, getAllByText, getAllByTitle, getByAltText, getByDisplayValue, getByLabelText, getByPlaceholderText, getByRole, getByTestId, getByText, getByTitle, queryAllByAltText, queryAllByDisplayValue, queryAllByLabelText, queryAllByPlaceholderText, queryAllByRole, queryAllByTestId, queryAllByText, queryAllByTitle, queryByAltText, queryByDisplayValue, queryByLabelText, queryByPlaceholderText, queryByRole, queryByTestId, queryByText, queryByTitle, screen, waitFor, within } from '@testing-library/react' export { default as userEvent } from '@testing-library/user-event' export { customRender as render }

Search equations, builds, manuscript text, and recovered sources.