You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@texera.apache.org by "Ma77Ball (via GitHub)" <gi...@apache.org> on 2026/06/07 12:33:15 UTC

[I] Add unit tests for RowModalComponent (result-panel-modal) [texera]

Ma77Ball opened a new issue, #5469:
URL: https://github.com/apache/texera/issues/5469

   ### 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)
   
   1. Create the spec next to the component, with the Apache license header.
   2. Provide stubs for the three injected dependencies (see below).
   3. Assert creation, and that `ngOnChanges()` produces the expected state (inspect the
      method body to see which field it sets from `workflowResultService` / `modal`).
   4. 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
   
   ```ts
   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
   
   - [ ] Refactor / Cleanup
   - [ ] DevOps / Deployment / CI
   - [x] Testing / QA
   - [ ] Documentation
   - [ ] Performance
   - [ ] Other


-- 
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: notifications-unsubscribe@texera.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Add unit tests for RowModalComponent (result-panel-modal) [texera]

Posted by "xuang7 (via GitHub)" <gi...@apache.org>.
xuang7 closed issue #5469: Add unit tests for RowModalComponent (result-panel-modal)
URL: https://github.com/apache/texera/issues/5469


-- 
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: notifications-unsubscribe@texera.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Add unit tests for RowModalComponent (result-panel-modal) [texera]

Posted by "Ma77Ball (via GitHub)" <gi...@apache.org>.
Ma77Ball commented on issue #5469:
URL: https://github.com/apache/texera/issues/5469#issuecomment-4642701993

   reserved for first-time contributor


-- 
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: notifications-unsubscribe@texera.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Add unit tests for RowModalComponent (result-panel-modal) [texera]

Posted by "Neilk1021 (via GitHub)" <gi...@apache.org>.
Neilk1021 commented on issue #5469:
URL: https://github.com/apache/texera/issues/5469#issuecomment-4654827002

   /take


-- 
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: notifications-unsubscribe@texera.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org