mengw15 opened a new pull request, #6554: URL: https://github.com/apache/texera/pull/6554
### What changes were proposed in this PR? Extends the existing `AdminExecutionComponent` spec (previously ~43% coverage) to cover the untested helpers, data flow, table handlers and execution actions. 20 added tests, in a new describe block that mocks `AdminExecutionService` and does **not** call `detectChanges()` (so `ngOnInit`'s pollers never start): - **Pure helpers** — `padZero`, `convertSecondsToTime`, `maxStringLength`, `getStatusColor` (incl. the default), `convertTimeToTimestamp`, and `calculateTime` (both the fixed-duration and the live-elapsed branches). - **Time status** — `specifyCompletedStatus` (COMPLETED→JUST COMPLETED within 5s and the reverse after 5s), `updateTimeDifferences`, `updateTimeStatus` (delegation), and `dataCheck`. - **Data / table** — `fetchData` (populates list/total/loading), `onFilterChange`, and `onSortChange` (set + reset-to-`NO_SORT`). - **Actions** — `killExecution` / `pauseExecution` / `resumeExecution` (open the socket for the workflow and send the right request, then refresh) and `clickToViewHistory` (opens the history modal). **Determinism (no flaky tests):** the `Date.now()`-based methods run under `vi.useFakeTimers()` + a fixed `setSystemTime`; `convertTimeToTimestamp` is asserted against the same `toLocaleString` call so it is timezone-independent; the websocket-based actions spy `WorkflowWebsocketService.prototype` `openWebsocket`/`send` (so no real socket opens and the constructor's heartbeat interval never fires under fake timers); `fixture.destroy()` runs in `afterEach`. Verified locally: 30/30 pass, **10 consecutive runs with zero flakes**, and the failure path checked. No production code was changed. ### Any related issues, documentation, discussions? Closes #6550 ### How was this PR tested? Extended unit tests, run locally in `frontend/`: ``` ng test --watch=false --include src/app/dashboard/component/admin/execution/admin-execution.component.spec.ts # Test Files 1 passed (1) | Tests 30 passed (30) (10x consecutive, 0 flakes) prettier --write <spec> # unchanged eslint <spec> # clean ``` ### 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]
