The GitHub Actions job "Required Checks" on 
texera.git/gh-readonly-queue/main/pr-7304-ae1d1d88e6d6a3f3559eb6512a679959da152421
 has succeeded.
Run started by GitHub user aglinxinyuan (triggered by aglinxinyuan).

Head commit for run:
cd28761ba02f80b9028599f045a1326f7bc54a85 / Xinyuan Lin <[email protected]>
test(frontend): cover the codearea template and breakpoint popup placement 
(#7304)

### What changes were proposed in this PR?

Two workspace editor sub-components whose specs stopped early.

| Component | Before | Tests now |
|---|---|---|
| `codearea-custom-template` | 64.5%, one "should create" test | 6 |
| `breakpoint-condition-input` | 63.9%, condition + keyboard paths | 13
|

**`CodeareaCustomTemplateComponent`** had a single creation test. Its
actual job is keeping one shared, per-operator "is the editor open" flag
in sync across three inputs — this component opening or closing the
editor, a co-editor opening the same one remotely, and the component
being torn down while the editor is still up. The flag lives in
`CodeEditorService` keyed by operator id, so a mix-up there silently
reopens the wrong operator's editor.

Also pinned: `ngOnDestroy` persists the **current** flag rather than a
hardcoded false (so a component torn down with its editor up comes back
open), and the created editor is handed **this field's** form control
rather than a fresh one — otherwise the dialog opens detached from the
property it is meant to edit.

The co-editor test stubs `getCoeditorOpenedCodeEditorSubject` and builds
its own fixture, because the component subscribes in its **constructor**
and that getter returns `asObservable()`. Casting the result back to a
`Subject` would only work by accident of the current implementation —
the same trap that came up in review on the mini-map spec.

**`BreakpointConditionInputComponent`**'s popup has no layout of its
own; it is positioned by arithmetic over Monaco's reported geometry, and
none of `left()`, `top()`, `isVisible` or the css offsets written by
`ngOnChanges` was tested. The existing stub supplies distinguishable
non-zero values, so every new expectation is a specific number —

```
left() = 30 (rect.left) + 10 (glyphMarginLeft) - 0 (scrollLeft) - 160 (popup 
width) = -120
top()  = 20 (rect.top)  + 40 (line bottom)    - 5 (scrollTop)                   
    =   55
```

— rather than a zero that jsdom would produce anyway. Also covers both
the no-editor and no-line guards, and the horizontal scroll offset that
only `left()` reads (so a copy-paste of `top()`'s body would be caught).

`code-debugger.component.ts` (20 missed) is deliberately out of scope:
its spec already has 16 tests covering the decoration and status-change
handlers, and the residue looked like it would need padding rather than
real assertions. Said plainly rather than quietly skipped.

No production file is touched.

### Any related issues, documentation, discussions?

Closes #7301

### How was this PR tested?

```
npx ng test --watch=false 
--include="**/codearea-custom-template.component.spec.ts" 
--include="**/breakpoint-condition-input.component.spec.ts"
```

```
 ✓ .../breakpoint-condition-input.component.spec.ts (13 tests)
 ✓ .../codearea-custom-template.component.spec.ts (6 tests)
 Test Files  2 passed (2)
```

`yarn format:ci` passes (prettier-eslint + eslint), which Vitest does
not cover on its own — it flagged both files on the first attempt.

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

Generated-by: Claude Code (Opus 5)

---------

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

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

With regards,
GitHub Actions via GitBox

Reply via email to