Skip to content

Extend the codearea template and breakpoint popup specs #7301

Closed

Description

@aglinxinyuan

Task Summary

Two workspace editor sub-components whose specs stop early:

File Missed Coverage Existing spec
codearea-custom-template.component.ts 11 64.5% one "should create" test
breakpoint-condition-input.component.ts 10 63.9% condition + keyboard paths only

CodeareaCustomTemplateComponent's 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 silently reopens the wrong operator's editor. Also worth pinning that ngOnDestroy persists the current flag rather than a hardcoded false, and that the created editor receives this field's form control rather than a fresh one.

One trap: the component subscribes to the co-editor stream in its constructor, and getCoeditorOpenedCodeEditorSubject() returns asObservable(). So a co-editor test has to stub the getter before the component is built — casting its result back to a Subject only works by accident of the current implementation.

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 is tested. The existing stub already supplies distinguishable non-zero values, so expectations can be specific numbers rather than the zeros jsdom would produce anyway. Both no-editor and no-line guards are uncovered, as is the horizontal scroll offset that only left() reads.

Note Vitest has no toBeTrue/toBeFalse — those are Jasmine matchers and fail to typecheck here.

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 looks like it would need padding rather than real assertions.

Task Type

  • Refactor / Cleanup
  • DevOps / Deployment / CI
  • Testing / QA
  • Documentation
  • Performance
  • Other

Activity

  1. added theissue type on Aug 4, 2026
  2. added a commit that references this issue on Aug 5, 2026
    cd28761
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions