Skip to content

fix: split basic catalog unit tests into per-component files#1408

Merged
josemontespg merged 2 commits into
google:mainfrom
azra-ai-oss:fix/split-basic-catalog-unit-tests
May 16, 2026
Merged

fix: split basic catalog unit tests into per-component files#1408
josemontespg merged 2 commits into
google:mainfrom
azra-ai-oss:fix/split-basic-catalog-unit-tests

Conversation

@brucearctor
Copy link
Copy Markdown
Contributor

Summary

Split simple-components.spec.ts and complex-components.spec.ts into individual test files, one per component. This produces smaller files with self-contained test setup, reducing complexity and merge conflict likelihood.

Changes

Deleted:

  • simple-components.spec.ts (6 components, 441 lines)
  • complex-components.spec.ts (6 components, 663 lines)

Created (13 files):

From simple-components.spec.ts From complex-components.spec.ts
divider.component.spec.ts check-box.component.spec.ts
image.component.spec.ts choice-picker.component.spec.ts
icon.component.spec.ts slider.component.spec.ts
video.component.spec.ts date-time-input.component.spec.ts
audio-player.component.spec.ts list.component.spec.ts
card.component.spec.ts tabs.component.spec.ts
modal.component.spec.ts

Each file is fully self-contained with its own mock setup — no shared state between files.

Testing

All 229 tests pass (npm run test:ci in renderers/angular).

Fixes #1403

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the Angular component testing suite by decomposing large test files into individual specification files for each component, alongside minor documentation updates to the catalog schema. Feedback highlights opportunities to improve test robustness and type safety, specifically by utilizing optional chaining for DOM elements, replacing 'any' types with more specific definitions as per the style guide, and adopting more resilient element selectors. Additionally, the reviewer suggests strengthening assertions by verifying specific arguments in spy calls.

Comment thread renderers/angular/src/v0_9/catalog/basic/audio-player.component.spec.ts Outdated
Comment thread renderers/angular/src/v0_9/catalog/basic/card.component.spec.ts Outdated
Comment thread renderers/angular/src/v0_9/catalog/basic/check-box.component.spec.ts Outdated
Comment thread renderers/angular/src/v0_9/catalog/basic/choice-picker.component.spec.ts Outdated
Comment thread renderers/angular/src/v0_9/catalog/basic/date-time-input.component.spec.ts Outdated
@ditman
Copy link
Copy Markdown
Collaborator

ditman commented May 15, 2026

Haha I love this! PTAL @josemontespg!

@josemontespg josemontespg self-requested a review May 15, 2026 07:12
Copy link
Copy Markdown
Collaborator

@josemontespg josemontespg left a comment

Choose a reason for hiding this comment

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

Thanks for doing this! I left some minor comments, please take a look when you can. Also, bring the branch up to date with main and we should be good to go!

Thank you for the contribution! ❤️

Comment thread specification/v0_10/json/basic_catalog.json
Comment thread specification/v0_9/json/basic_catalog.json
Split simple-components.spec.ts and complex-components.spec.ts into
individual test files, one per component. This produces smaller files
with self-contained test setup, reducing complexity and merge conflict
likelihood.

New files created:
- divider.component.spec.ts
- image.component.spec.ts
- icon.component.spec.ts
- video.component.spec.ts
- audio-player.component.spec.ts
- card.component.spec.ts
- check-box.component.spec.ts
- choice-picker.component.spec.ts
- slider.component.spec.ts
- date-time-input.component.spec.ts
- list.component.spec.ts
- tabs.component.spec.ts
- modal.component.spec.ts

Deleted files:
- simple-components.spec.ts
- complex-components.spec.ts

Fixes google#1403
@brucearctor brucearctor force-pushed the fix/split-basic-catalog-unit-tests branch from c4b65db to 9cafe92 Compare May 15, 2026 23:14
@brucearctor
Copy link
Copy Markdown
Contributor Author

Thanks for the review @josemontespg! Reverted the basic_catalog.json changes from both v0_9 and v0_10 — those belong in the separate PR #1409 for the ADK ${expression} fix. Branch is now rebased on latest main and squashed to a single commit. PTAL!

@josemontespg
Copy link
Copy Markdown
Collaborator

Looks good, thanks! 👏

@josemontespg josemontespg merged commit 9423435 into google:main May 16, 2026
14 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in A2UI May 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Split unit tests of the 0.9 Angular basic catalog components

3 participants