Skip to content

BUG: TypeScript type errors in diary unit tests after sourceEntityTitle added to shared types #847

@steilerDev

Description

@steilerDev

BUG: TypeScript type errors in diary unit tests after sourceEntityTitle added to shared types

Severity: Major
Component: QA Integration Tests / Shared Types
Found in: CI Static Analysis job on PR #846

Steps to Reproduce

  1. Open PR fix(diary): address 10 UAT feedback items for EPIC-13 (#836-#845) #846 on branch fix/836-845-diary-uat-fixes
  2. Observe Static Analysis (typecheck) fails with TypeScript errors

Expected Behavior

TypeScript typecheck passes with 0 errors.

Actual Behavior

Multiple TypeScript errors in `client/` test files because the UAT fix (commit `91bc6fc`) added `sourceEntityTitle` as a required field to `DiaryEntrySummary` and `DiaryEntryDetail` types in `@cornerstone/shared`, but the QA integration test mock objects were not updated.

Affected files:

  • `client/src/lib/diaryApi.test.ts` — mock objects missing `sourceEntityTitle` field
  • `client/src/pages/DiaryEntryCreatePage/DiaryEntryCreatePage.test.tsx` — mock objects missing `sourceEntityTitle`
  • `client/src/pages/DiaryEntryEditPage/DiaryEntryEditPage.test.tsx` — mock objects missing `sourceEntityTitle`

Error:
```
Property 'sourceEntityTitle' is missing in type '{ id: string; entryType: "daily_log"; ... }'
but required in type 'DiaryEntryDetail'.
```

Fix Required

Add `sourceEntityTitle: null` to all mock objects of type `DiaryEntrySummary` and `DiaryEntryDetail` in the affected test files.

Environment

Notes

This is a qa-integration-tester responsibility. The E2E tests are not affected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions