ATLAS-5174: Set up Test Infrastructure and Configuration for Atlas Dashboard#632
Open
pawarprasad123 wants to merge 1 commit into
Open
ATLAS-5174: Set up Test Infrastructure and Configuration for Atlas Dashboard#632pawarprasad123 wants to merge 1 commit into
pawarprasad123 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.*),jsdomenvironment,ts-jest, path aliases (@components,@utils, etc.), coverage settings, and optional exclusion of governance tests unlessRUN_DEPENDENCY_GOVERNANCE=1.TypeScript for tests (
tsconfig.test.json,tsconfig.build.jsonif referenced): Ensures tests type-check consistently with the app’s module settings.Babel (
.babelrc.jsonif 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/matchMediashims, sharedjest.mockfor 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): Sharedrenderhelpers (e.g. Redux/Router providers) to avoid duplicating boilerplate.ESLint (
/.eslintrc.cjs): Adds anoverridesblock only for tests, mocks, and setup so idiomatic Jest patterns (requirein factories, hook usage in mocks, etc.) do not fail lint, while productionsrckeeps stricter rules.Package manifest (
package.json,package-lock.json): Jest/RTL/ts-jest/babel andnpmscripts (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
