Skip to content

fix(frontend/test): add missing escapeHtmlAttr to utils mocks (Build frontend CI red) #1115

Description

@cristim

Problem

frontend/src/plans.ts (11 call sites) and frontend/src/history.ts (6) use escapeHtmlAttr, but several test suites' jest.mock('../utils', () => ({ ... })) factories do not stub escapeHtmlAttr. When those tests render plans/history, the call throws:

TypeError: (0 , utils_1.escapeHtmlAttr) is not a function

This fails the "Build frontend" CI job (it runs the jest suites) on the base branch and on every frontend PR (e.g. visible on #1114, which only inherited it). plans.test.ts and the history-* suites are affected.

Fix

Add an escapeHtmlAttr stub to the jest.mock('../utils', …) factory in each affected suite, mirroring the real helper (escapes & < > " '). frontend/src/__tests__/history.test.ts already has a correct stub to copy.

Acceptance criteria

  • Every frontend jest suite that renders plans/history mocks escapeHtmlAttr.
  • jest frontend suites pass (the 2 pre-existing formatDate/getDateParts timezone failures are unrelated and out of scope).
  • "Build frontend" CI goes green.

No activity

Activity on this issue will appear here.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions