-
Notifications
You must be signed in to change notification settings - Fork 49
[Project Solar / Phase 1 / Engineering Follow-ups] Converted tests for HdsThemeSwitcher and HdsThemeContext to .gts format
#3447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: project-solar/phase-1-main-feature-branch
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR converts integration tests for HdsThemeSwitcher and HdsThemeContext components from .ts format with hbs templates to the newer .gts format with inline template syntax. The conversion aligns with recent work to modernize the test suite and leverages Glimmer's template syntax improvements.
Key changes:
- Replaced
hbstemplate strings with inline<template>syntax - Updated component references from string-based to direct imports
- Converted test context variables to local scope variables with explicit TypeScript types
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
showcase/tests/integration/components/hds/theme-switcher/index-test.gts |
Converted all test cases to use inline template syntax, replaced this.themingService with typed local variable, and removed ember-cli-htmlbars dependency |
showcase/tests/integration/components/hds/theme-context/index-test.gts |
Converted test templates to inline syntax, replaced this.set() calls with direct variable references in templates, and removed ember-cli-htmlbars dependency |
| module('Integration | Component | hds/theme-switcher/index', function (hooks) { | ||
| setupRenderingTest(hooks); | ||
|
|
||
| let themingService: HdsThemingService; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: We tend to avoid using before/after each now to keep things scoped to the individual test and only have access to the actual things you need for the individual test.
See this example for how we set up services:
| const intl = this.owner.lookup('service:intl'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in d78a14b
(but, to me, it seems a lot of duplicated code for no reason, where the before/after I think are made exactly to avoid this)
📌 Summary
In previous PR #3428 we implemented the tests for the new HDS theming components in
.tsformat. Now that the main feature branch has been rebased onmainwe can leverage the work done by @shleewhite and convert these tests to.gtsformat as well.🛠️ Detailed description
In this PR I have:
HdsThemeSwitcherandHdsThemeContextto.gtsformatNote: the bulk of the work was done using Copilot in VSCode (GPT-5.2) and then tweaked.
🔗 External links
Jira ticket: https://hashicorp.atlassian.net/browse/HDS-5720
👀 Component checklist
💬 Please consider using conventional comments when reviewing this PR.
📋 PCI review checklist
Examples of changes to controls include access controls, encryption, logging, etc.
Examples include changes to operating systems, ports, protocols, services, cryptography-related components, PII processing code, etc.