mengw15 opened a new pull request, #6540:
URL: https://github.com/apache/texera/pull/6540
### What changes were proposed in this PR?
Extends the existing `TimeTravelComponent` spec
(`frontend/src/app/workspace/component/left-panel/time-travel/`), which only
had
`should create` (codecov ~34%), to cover its previously-untested methods.
Follows
`frontend/TESTING.md`.
Adds 11 tests under a nested `extended method coverage` block:
- **`getWid`** — returns the workflow id from the metadata; undefined when
absent.
- **`retrieveLoggedExecutions`** — keeps only executions with a non-empty
log location.
- **`retrieveInteractionHistory`** — GETs `.../{wid}/interactions/{eid}`
(verified via `HttpTestingController`).
- **`getInteractionHistory`** — no-ops without a wid; otherwise stores the
fetched history under the eid.
- **`displayExecutionWithLogs`** — stores the executions and refreshes the
interaction history of expanded rows.
- **`onInteractionClick`** — no-ops without a wid; otherwise loads the
versioned
workflow, displays it read-only, records the reverted interaction,
notifies, and
starts the replay.
- **`toggleRow`** — expands a collapsed row and loads its history; collapses
an
expanded row without reloading.
The `ngOnInit` 5s poller is neutralized by stubbing `getWorkflowMetadata` to
return
no wid, so its callback early-returns and no stray request lands in the
mock. No
production code was changed.
### Any related issues, documentation, discussions?
Closes #6532
### How was this PR tested?
Extended Vitest spec, run locally in `frontend/` (all green; failure path
verified
by breaking an assertion to confirm the suite goes red):
```
ng test --watch=false --include
src/app/workspace/component/left-panel/time-travel/time-travel.component.spec.ts
# Test Files 1 passed (1) / Tests 12 passed (12)
eslint <spec> # clean
prettier --check # clean
```
Services are stubbed via `vi.spyOn` and `HttpTestingController`, so the spec
makes
no real network calls.
### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 4.8 [1M context])
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]