The GitHub Actions job "npm_and_yarn in /frontend for postcss - Update 
#1358688937" on texera.git/main has failed.
Run started by GitHub user dependabot[bot] (triggered by dependabot[bot]).

Head commit for run:
bd445b5157253762209deb8cb4509e4343297e12 / Yicong Huang 
<[email protected]>
test(frontend): add unit tests for WorkspaceComponent (#4969)

### What changes were proposed in this PR?

The placeholder spec at
`frontend/src/app/workspace/component/workspace.component.spec.ts` was a
license header only. Replace it with real tests covering the public
surface of `WorkspaceComponent`:

- `ngOnInit` — query-param `pid` parsing (numeric / non-numeric) and
`setHighlightingEnabled` wiring
- `ngAfterViewInit` — cold-start (no `wid`) vs warm-start (`wid`
present, must show loading and disable modification); also asserts
`HubService.postView` is called with the route's `wid` and the current
user's `uid`, falling back to `0` when anonymous
- `loadWorkflowWithId` — success / 403-error paths, the broken-workflow
branch (`checkIfWorkflowBroken` → `NotificationService.error` but still
loads), and URL-fragment handling (highlight when present, error + clear
when stale)
- `onWIDChange` — `writeAccess` syncs from `metadata.readonly` on each
`workflowMetaDataChanged` emission, and stays put when the metadata's
`wid` is still undefined
- `triggerCenter` — delegates to
`WorkflowActionService.getTexeraGraph().triggerCenterEvent()`
- `registerAutoPersistWorkflow` — idempotent (only one subscription
regardless of repeated calls)
- `ngOnDestroy` — persists the workflow when the user is signed in and
persist is enabled; skips persist when not signed in; clears the
workflow either way
- `copilotEnabled` — passes through
`GuiConfigService.env.copilotEnabled`

The fixture overrides the component template to `<div #codeEditor>` so
the heavyweight children (workflow editor, mini-map, left/right panels)
don't have to compile in the test build, and stubs all 14 injected
services. Drop the spec from the exclude lists in `tsconfig.spec.json`
and `angular.json`.

### Any related issues, documentation, discussions?

Closes #4967.

### How was this PR tested?

`yarn ng test --watch=false`: 267 pass, 8 skip, 2 todo (19 new tests in
`WorkspaceComponent`). `yarn format:ci` clean.

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

Generated-by: Claude Opus 4.7 (1M context)

---------

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>

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

With regards,
GitHub Actions via GitBox

Reply via email to