fix(frontend/test): stub escapeHtmlAttr in utils mocks (Build frontend CI red) - #1116
Conversation
…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
|
@coderabbitai full review |
✅ Action performedFull review finished. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
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 |
|
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. |
Seven jest suites omitted
escapeHtmlAttrfrom theirjest.mock('../utils', ...)factory, causingTypeError: (0 , utils_1.escapeHtmlAttr) is not a functionwhenplans.ts/history.tsrender. Added the stub already present inhistory.test.ts(encodes& < > " ') to each affected suite. No production code changes. After fix: 2497 tests pass, only the 2 pre-existing timezone failures inutils.test.tsremain,tsc --noEmitis clean.Closes #1115