Skip to content

Conversation

@medbenmakhlouf
Copy link
Contributor

Summary

This PR improves the test suite by leveraging the new testing APIs introduced in Angular 20.1+, allowing us to simplify component tests and remove unnecessary boilerplate.

Details

  • Migrated existing tests to use the updated TestBed.createComponent options.
  • Replaced extra "host" components with direct component testing, reducing redundancy and making tests easier to read.
  • Introduced the use of bindings for input simulation:
const fixture = TestBed.createComponent(FaDuotoneIconComponent, {
  bindings: [
    inputBinding('icon', () => faDummy),
    inputBinding('secondaryOpacity', () => 0.9),
  ],
});

This makes input setup more explicit and avoids creating additional wrapper components.

Benefits

  • Less boilerplate: Fewer wrapper/host components.
  • Clearer tests: Inputs are defined directly where the component is created.
  • Future-proof: Aligns test setup with Angular 20.1+ best practices.

@medbenmakhlouf
Copy link
Contributor Author

@devoto13 thanks in advance for the review ;)

Copy link
Collaborator

@devoto13 devoto13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the late review!
LGTM

@devoto13 devoto13 merged commit 204c473 into FortAwesome:main Nov 24, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants