Task Summary
RowModalComponent (frontend/src/app/workspace/component/result-panel/result-panel-modal.component.ts) has no *.spec.ts file. It is a ~70-line modal with a single lifecycle hook (ngOnChanges). It depends on NzModalRef, WorkflowResultService, and PanelResizeService, all of which are easy to stub.
What to do (step by step)
- Create the spec next to the component, with the Apache license header.
- Provide stubs for the three injected dependencies (see below).
- Assert creation, and that
ngOnChanges() produces the expected state (inspect the method body to see which field it sets from workflowResultService / modal).
- Run
yarn test -- result-panel-modal, then yarn lint.
Cover
should create.
ngOnChanges() populates the row data the modal displays. Read the method to see which service call it makes (it uses the modal's numeric config and WorkflowResultService), stub that call, then assert the resulting component field.
Suggested providers / mocks
const workflowResultServiceSpy = { /* add the method ngOnChanges calls, as vi.fn() */ };
const resizeServiceSpy = { /* add any method used, as vi.fn() */ };
providers: [
{ provide: NzModalRef, useValue: { getConfig: () => ({}), close: vi.fn() } },
{ provide: WorkflowResultService, useValue: workflowResultServiceSpy },
{ provide: PanelResizeService, useValue: resizeServiceSpy },
]
Open the component first and match the stub methods to exactly what ngOnChanges and the constructor touch, so the stubs stay minimal.
Task Type
Task Summary
RowModalComponent(frontend/src/app/workspace/component/result-panel/result-panel-modal.component.ts) has no*.spec.tsfile. It is a ~70-line modal with a single lifecycle hook (ngOnChanges). It depends onNzModalRef,WorkflowResultService, andPanelResizeService, all of which are easy to stub.What to do (step by step)
ngOnChanges()produces the expected state (inspect the method body to see which field it sets fromworkflowResultService/modal).yarn test -- result-panel-modal, thenyarn lint.Cover
should create.ngOnChanges()populates the row data the modal displays. Read the method to see which service call it makes (it uses the modal's numeric config andWorkflowResultService), stub that call, then assert the resulting component field.Suggested providers / mocks
Open the component first and match the stub methods to exactly what
ngOnChangesand the constructor touch, so the stubs stay minimal.Task Type