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:24:04 UTC

[I] Adding Unit Test for SortButtonComponent [texera]

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

   ### Task Summary
   
   ### Task Summary
   
   `SortButtonComponent` (`frontend/src/app/dashboard/component/user/sort-button/sort-button.component.ts`) currently has no `*.spec.ts` file, so none of its logic is covered by the frontend test suite.
   
   This is a small, self-contained component that makes a great first task. It has no service dependencies. It just holds a `sortMethod` field (defaulting to `SortMethod.EditTimeDesc`) and exposes four methods that each set `sortMethod` and emit it through the `sortMethodChange` `@Output`:
   
   - `lastSort()` sets `SortMethod.EditTimeDesc`
   - `dateSort()` sets `SortMethod.CreateTimeDesc`
   - `ascSort()` sets `SortMethod.NameAsc`
   - `dscSort()` sets `SortMethod.NameDesc`
   
   **What to do**
   
   Add `frontend/src/app/dashboard/component/user/sort-button/sort-button.component.spec.ts` that:
   
   - creates the component via `TestBed` (mirroring an existing simple spec such as `frontend/src/app/dashboard/component/user/list-item/list-item.component.spec.ts`),
   - asserts the component is created and that `sortMethod` defaults to `SortMethod.EditTimeDesc`,
   - for each of the four methods, asserts it sets `sortMethod` to the expected value and emits that value through `sortMethodChange` (subscribe to the output, or `vi.spyOn(component.sortMethodChange, "emit")`).
   
   **Notes for the contributor**
   
   - The frontend test runner is Vitest. Run the suite from the `frontend/` directory with `yarn test` (see `AGENTS.md`).
   - Keep the Apache license header at the top of the new file (copy it from any sibling `*.spec.ts`).
   - Look at neighboring specs in the same folder for the import and `TestBed` boilerplate to follow.
   
   ### Task Type
   
   - [ ] Refactor / Cleanup
   - [ ] DevOps / Deployment / CI
   - [x] Testing / QA
   - [ ] Documentation
   - [ ] Performance
   - [ ] Other
   
   ### Task Type
   
   - [ ] Refactor / Cleanup
   - [ ] DevOps / Deployment / CI
   - [ ] 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] Adding Unit Test for SortButtonComponent [texera]

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

   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 SortButtonComponent [texera]

Posted by "xuang7 (via GitHub)" <gi...@apache.org>.
xuang7 closed issue #5463: Add unit tests for SortButtonComponent
URL: https://github.com/apache/texera/issues/5463


-- 
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 SortButtonComponent [texera]

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

   /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