feat(components/theme,i18n): add test harnesses for theme and i18n libraries#8
Open
devin-ai-integration[bot] wants to merge 5 commits intomainfrom
Open
feat(components/theme,i18n): add test harnesses for theme and i18n libraries#8devin-ai-integration[bot] wants to merge 5 commits intomainfrom
devin-ai-integration[bot] wants to merge 5 commits intomainfrom
Conversation
…braries - Add @skyux/theme/testing package with SkyThemeHarness for testing theme directives - Add @skyux/i18n/testing package with SkyResourcesHarness for testing localized content - Update tsconfig.base.json with testing package path mappings - Include comprehensive unit tests for both harnesses Co-Authored-By: benc@cognition.ai <Benc@windsurf.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
- Fix formatting issues in test files and tsconfig.base.json - Add @angular/cdk and @skyux/core as peer dependencies to i18n and theme libraries Co-Authored-By: benc@cognition.ai <Benc@windsurf.com>
- Remove @skyux/core from i18n peer dependencies to avoid circular dependency - Restructure i18n harness to extend ComponentHarness directly from @angular/cdk/testing - Create local implementation of dataSkyId filter to avoid importing from @skyux/core/testing Co-Authored-By: benc@cognition.ai <Benc@windsurf.com>
- Remove @skyux/core from theme peer dependencies to avoid circular dependency - Restructure theme harness to extend ComponentHarness directly from @angular/cdk/testing - Create local implementation of dataSkyId filter to avoid importing from @skyux/core/testing Co-Authored-By: benc@cognition.ai <Benc@windsurf.com>
Co-Authored-By: benc@cognition.ai <Benc@windsurf.com>
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.
feat(components/theme,i18n): add test harnesses for theme and i18n libraries
Summary
This PR adds test harnesses for two core infrastructure components that previously lacked testing support:
@skyux/theme/testing -
SkyThemeHarnessfor testing components that use the[skyTheme]directive. Exposes methods to query theme state includinggetThemeName(),getThemeMode(),getThemeSpacing(), and convenience boolean methods likeisModernTheme(),isDarkMode(), etc.@skyux/i18n/testing -
SkyResourcesHarnessfor testing elements that display localized content. ProvidesgetText(),getInnerHtml(), andgetAttribute()methods.Both harnesses follow established patterns from existing harnesses in the codebase, extending
SkyComponentHarnessand implementing the standardwith()filter method.Review & Testing Checklist for Human
SkyResourcesHarnessuses[skyLibResources],[skyAppResources]as the host selector. Confirm this matches actual usage patterns in consuming applications, as these appear to be pipe names rather than directive selectors.SkyThemeHarnessdetects theme state by checking CSS classes (sky-theme-modern,sky-theme-mode-dark,sky-theme-modern-compact). Confirm these class names are stable and correctly applied by the theme service.Recommended test plan: After CI passes, import
SkyThemeHarnessandSkyResourcesHarnessin an existing component test file and verify they can be instantiated and queried correctly.Notes
Link to Devin run: https://app.devin.ai/sessions/40159d8b73b6471dbfc064046a58280e
Requested by: @bcmake