test: add unit and integration tests for Backstage plugin #6
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.
Summary
Add comprehensive unit and integration tests for the Flagsmith Backstage plugin, plus GitHub Actions CI for running tests on every PR.
Closes #6424
Changes
CI/CD
yarn test --coverage --ci)Test Infrastructure
renderWithBackstage,createMockFetchApi) for consistent test setupUnit Tests
flagHelpers.ts):getFeatureEnvStatus,buildEnvStatusTooltip,calculateFeatureStats,paginateflagsmithTheme.ts):buildFlagUrl,buildProjectUrlURL buildersFlagsmithClient.ts): All methods with mocked fetch and error handlinguseFlagsmithProject,useFlagsmithUsagewith loading/success/error statesComponent Tests
LoadingState,MiniPagination,FlagStatusIndicator,FlagsmithLink,SearchInputFlagsTab,FlagsmithOverviewCard,FlagsmithUsageCardTest Coverage
Commits
ci: add test job to GitHub Actions workflowtest: add test fixtures and utilitiestest(utils): add unit tests for flagHelperstest(theme): add unit tests for flagsmithThemetest(api): add unit tests for FlagsmithClienttest(hooks): add unit tests for custom hookstest(components): add unit tests for shared componentstest(components): add integration tests for main componentsTest Plan
🤖 Generated with Claude Code