Skip to content

Conversation

@didoo
Copy link
Contributor

@didoo didoo commented Dec 19, 2025

📌 Summary

In previous PR #3428 we implemented the tests for the new HDS theming components in .ts format. Now that the main feature branch has been rebased on main we can leverage the work done by @shleewhite and convert these tests to .gts format as well.

🛠️ Detailed description

In this PR I have:

  • converted tests for HdsThemeSwitcher and HdsThemeContext to .gts format

Note: 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
  • If applicable, I've documented a plan to revert these changes if they require more than reverting the pull request.
  • If applicable, I've worked with GRC to document the impact of any changes to security controls.
    Examples of changes to controls include access controls, encryption, logging, etc.
  • If applicable, I've worked with GRC to ensure compliance due to a significant change to the in-scope PCI environment.
    Examples include changes to operating systems, ports, protocols, services, cryptography-related components, PII processing code, etc.

@didoo didoo requested review from Copilot and shleewhite December 19, 2025 17:42
@didoo didoo requested a review from a team as a code owner December 19, 2025 17:42
@vercel
Copy link

vercel bot commented Dec 19, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
hds-showcase Ready Ready Preview Dec 19, 2025 8:13pm
hds-website Ready Ready Preview Dec 19, 2025 8:13pm

Copy link
Contributor

Copilot AI left a 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 hbs template 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;
Copy link
Contributor

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');

Copy link
Contributor Author

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)

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants