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:18:57 UTC

[I] Add unit tests for SortButtonComponent [texera]

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

   ### 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
   
   ---
   
   By submitting this issue, you agree to follow the [Apache Code of Conduct](https://www.apache.org/foundation/policies/conduct).
   


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

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


-- 
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 "Ma77Ball (via GitHub)" <gi...@apache.org>.
Ma77Ball commented on issue #5462:
URL: https://github.com/apache/texera/issues/5462#issuecomment-4642883208

   Duplicate of #5463 (same target: `SortButtonComponent`). Closing in favor of #5463, which is part of the spec-coverage batch. Tracking the work there.


-- 
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 "Ma77Ball (via GitHub)" <gi...@apache.org>.
Ma77Ball commented on issue #5462:
URL: https://github.com/apache/texera/issues/5462#issuecomment-4642527081

   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 "Ma77Ball (via GitHub)" <gi...@apache.org>.
Ma77Ball closed issue #5462: Add unit tests for SortButtonComponent
URL: https://github.com/apache/texera/issues/5462


-- 
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