The GitHub Actions job "Required Checks" on 
texera.git/gh-readonly-queue/main/pr-6431-d561da8f3ca8b3ee6ce39b9a66320372d295f186
 has failed.
Run started by GitHub user mengw15 (triggered by mengw15).

Head commit for run:
54fa99485848197a9b80a781c6f740e065374734 / Meng Wang <[email protected]>
test(frontend): add unit test coverage for MarkdownDescriptionComponent (#6431)

### What changes were proposed in this PR?

Adds a behavior-focused Vitest spec for `MarkdownDescriptionComponent`

(`frontend/src/app/dashboard/component/user/markdown-description/markdown-description.component.ts`),
which previously had no spec (~46% coverage).

> Note: issue #6428 lists the path as
`workspace/component/markdown-description/`;
> the component actually lives under
`dashboard/component/user/markdown-description/`.

14 tests (TestBed + `detectChanges()`, `MarkdownService` stubbed,
`NZ_MODAL_DATA`
provided only for the modal cases) cover:

- `should create` and render the preview template.
- The `editable` input toggling the preview-mode Edit action (shown /
hidden).
- `ngOnInit` — inline case: starts in `preview`, seeds `editingContent`
from `description`; modal case: `editable = true`, `currentMode =
"edit"`, `description` pulled from modal data (and defaulted to `""`
when omitted).
- `ngOnChanges` — refreshes `editingContent` + re-renders on a non-first
`description` change in preview mode; leaves it untouched under the
edit-mode guard; ignores the first change.
- `enterEditMode` — switches to edit mode only when `editable`.
- `save` — emits `descriptionChange` with the edited content; returns to
`preview` inline but stays in `edit` when opened in a modal.
- `cancel` — restores `editingContent` from `description` and returns to
`preview`.
- `renderMarkdown` — renders non-empty input and clears on blank input
without parsing.

No production code was changed.

### Any related issues, documentation, discussions?

Closes #6428

### How was this PR tested?

New unit tests, run locally in `frontend/` (all green; the failure path
was
verified by deliberately breaking an assertion to confirm the suite goes
red):

```
ng test --watch=false --include 
src/app/dashboard/component/user/markdown-description/markdown-description.component.spec.ts
# Test Files 1 passed (1) | Tests 14 passed (14)
prettier --write <spec>   # formatted
eslint  <spec>            # clean
```

`MarkdownService.parse` is stubbed and `NZ_MODAL_DATA` is injected via
the test
module, so the suite makes no network calls and needs no real markdown
config
(see `frontend/TESTING.md`).

### Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Opus 4.8 [1M context])

---------

Signed-off-by: Meng Wang <[email protected]>
Co-authored-by: Copilot Autofix powered by AI 
<[email protected]>

Report URL: https://github.com/apache/texera/actions/runs/29377958010

With regards,
GitHub Actions via GitBox

Reply via email to