.agents/skills/frontend-testing/references/checklist.md
Verify each item before submitting test code for Langflow frontend.
&&/|| short-circuits)jest.setup.js for pre-existing global mocks to avoid duplication__tests__/ directory or co-located with sourceComponentName.test.tsx or util-name.test.ts convention@/ path alias consistentlyjest.mock() calls are at the top of the file, after importsbeforeEach includes jest.clearAllMocks()beforeEach resets Zustand store state (if using stores)afterEach cleans up fake timers (if used)it() block tests exactly ONE behavior"should [behavior] when [condition]" formatgetByRole > getByLabelText > getByText > getByTestIdqueryBy* used for asserting absence (expect(queryByText("x")).not.toBeInTheDocument())findBy* or waitFor used for async elementsscreen object used for all queries (not destructured from render)jest-dom matchers: toBeInTheDocument(), toHaveValue(), toBeDisabled(), etc..innerHTML, .className, or .style for assertionsuserEvent.setup() used (not fireEvent)userEvent calls are awaiteduserEvent.setup({ advanceTimers: jest.advanceTimersByTime }) used when combining with fake timersjest.fn(), jest.mock(), jest.spyOn() (NEVER vi.*)@/components/ui/jest.setup.jsjest.mocked() used for type-safe mock assertionswaitFor calls contain a single assertionawaitedact() wraps state-updating operations (store updates, timer advances)afterEach: jest.runOnlyPendingTimers() then jest.useRealTimers()null, undefined, "", [], {}, 0, -1npm test -- path/to/file.test.tsxnpm test -- --coverage --collectCoverageFrom='src/path/to/source.ts' path/to/test.test.tsconsole.log left in test code.only or .skip left on testsany type assertions that could be properly typedtestPathIgnorePatterns (not named test-utils.tsx)