Skip to content

fix(frontend/test): stub escapeHtmlAttr in utils mocks (Build frontend CI red) - #1116

Merged
cristim merged 1 commit into
feat/multicloud-web-frontendfrom
fix/frontend-test-escapehtmlattr-mock
Jun 8, 2026
Merged

fix(frontend/test): stub escapeHtmlAttr in utils mocks (Build frontend CI red)#1116
cristim merged 1 commit into
feat/multicloud-web-frontendfrom
fix/frontend-test-escapehtmlattr-mock

Conversation

@cristim

@cristim cristim commented Jun 8, 2026

Copy link
Copy Markdown
Member

Seven jest suites omitted escapeHtmlAttr from their jest.mock('../utils', ...) factory, causing TypeError: (0 , utils_1.escapeHtmlAttr) is not a function when plans.ts/history.ts render. Added the stub already present in history.test.ts (encodes & < > " ') to each affected suite. No production code changes. After fix: 2497 tests pass, only the 2 pre-existing timezone failures in utils.test.ts remain, tsc --noEmit is clean.

Closes #1115

…ld frontend

Seven jest suites (plans, history-retry-button, history-approve-button,
history-approval-queue, history-cancel-button, history-cancel-permissions,
allowed-accounts) each had a jest.mock('../utils', ...) factory that
omitted escapeHtmlAttr. When plans.ts and history.ts call it at render
time the mock throws "TypeError: (0 , utils_1.escapeHtmlAttr) is not a
function", causing cascading test failures.

Added the same escapeHtmlAttr stub already present in history.test.ts
(encodes & < > " ') to each affected factory. No logic changes.

Closes #1115
@cristim cristim added triaged Item has been triaged priority/p2 Backlog-worthy severity/medium Moderate harm urgency/this-sprint Within the current sprint impact/internal Team-internal only effort/s Hours type/bug Defect labels Jun 8, 2026
@cristim

cristim commented Jun 8, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Full review finished.

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2a4b33ef-6b14-4e35-b7cc-7cd18612c918

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/frontend-test-escapehtmlattr-mock

Comment @coderabbitai help to get the list of available commands and usage tips.

@cristim
cristim merged commit ad5b348 into feat/multicloud-web-frontend Jun 8, 2026
4 of 5 checks passed
@cristim

cristim commented Jun 8, 2026

Copy link
Copy Markdown
Member Author

Closing as redundant: all seven test suites this PR stubs (allowed-accounts, history-approval-queue, history-approve-button, history-cancel-button, history-cancel-permissions, history-retry-button, plans.test.ts) already have the escapeHtmlAttr mock on feat/multicloud-web-frontend. The one remaining gap (plans-range-validation.test.ts, 0 stubs on base) is fixed by #1117, which is CLEAN and green. No unique content here to preserve. Closes the duplicate for #1115.

@cristim

cristim commented Jun 8, 2026

Copy link
Copy Markdown
Member Author

Correction to my previous comment: this PR is merged and was the primary fix (7 suites). It is NOT redundant. #1117 complements it by stubbing the one suite this PR did not cover (plans-range-validation.test.ts). Apologies for the mischaracterization.

@cristim
cristim deleted the fix/frontend-test-escapehtmlattr-mock branch July 27, 2026 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/s Hours impact/internal Team-internal only priority/p2 Backlog-worthy severity/medium Moderate harm triaged Item has been triaged type/bug Defect urgency/this-sprint Within the current sprint

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant