Skip to content

ATLAS-5174: Set up Test Infrastructure and Configuration for Atlas Dashboard#632

Open
pawarprasad123 wants to merge 1 commit into
masterfrom
ATLAS-5174
Open

ATLAS-5174: Set up Test Infrastructure and Configuration for Atlas Dashboard#632
pawarprasad123 wants to merge 1 commit into
masterfrom
ATLAS-5174

Conversation

@pawarprasad123
Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Add Jest test infrastructure, ESLint test overrides, and shared test harness
This PR establishes how the dashboard runs and lints unit tests. It does not add feature test cases

What changes do

  • Jest config (jest.config.js): Defines where tests live (__tests__, *.test.*), jsdom environment, ts-jest, path aliases (@components, @utils, etc.), coverage settings, and optional exclusion of governance tests unless RUN_DEPENDENCY_GOVERNANCE=1.

  • TypeScript for tests (tsconfig.test.json, tsconfig.build.json if referenced): Ensures tests type-check consistently with the app’s module settings.

  • Babel (.babelrc.json if present): Lets Jest transform JS/ESM dependencies where needed.

  • Setup files (src/setupTests.ts, src/setupTests.simple.ts): Run before tests (e.g. @testing-library/jest-dom, ResizeObserver / matchMedia shims, shared jest.mock for heavy components like table layout).

  • Module mocks (src/__mocks__/**): Replace assets (CSS, images), react-quill-new, and co-located UI so tests stay fast and deterministic.

  • Test utilities (src/utils/test-utils.tsx): Shared render helpers (e.g. Redux/Router providers) to avoid duplicating boilerplate.

  • ESLint (/.eslintrc.cjs): Adds an overrides block only for tests, mocks, and setup so idiomatic Jest patterns (require in factories, hook usage in mocks, etc.) do not fail lint, while production src keeps stricter rules.

  • Package manifest (package.json, package-lock.json): Jest/RTL/ts-jest/babel and npm scripts (test, test:coverage, test:governance, etc.) so CI and developers run the same commands.

  • Governance doc (docs/DEPENDENCY_AND_DEPENDABOT_TEST_PLAN.md): Documents optional dependency/governance workflow (paired with governance tests in PR 6).

  • Without them, tests either do not run, fail to resolve imports, or lint incorrectly; later PRs depend on this foundation first.

How was this patch tested?

Manual test, test pass
Screenshot from 2026-05-14 16-26-37

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant