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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to