test: add unit tests for SortButtonComponent (#5463)#5578
Conversation
|
👋 Thanks for your first contribution to Texera, @Neilk1021! You can drive common housekeeping tasks just by leaving a comment. Type the command on its own line. On issues
To find unclaimed work, search Linking sub-issues
You can write references as On pull requests (author only)
You can mention teams as
For the full contribution flow, see CONTRIBUTING.md. |
|
@xuang7 Can you review this PR? |
xuang7
left a comment
There was a problem hiding this comment.
Thanks for the PR! Overall, it looks good to me. I noticed that the new spec file in this PR has a UTF-8 BOM, so we could remove it. Also, please follow the PR template and update the PR description accordingly.
What changes were proposed in this PR?
This PR adds a comprehensive unit test suite (
sort-button.component.spec.ts) for theSortButtonComponent.The newly introduced test cases verify that:
lastSort(),dateSort(),ascSort(), anddscSort()updates the internalsortMethodstate correctly and fires the expected payload through thesortMethodChangeevent emitter.Any related issues, documentation, discussions?
Closes #5463
How was this PR tested?
This PR was tested by running the newly added unit test suite (
sort-button.component.spec.ts) to ensure all test cases pass successfully and cover both state updates and event emissions.Was this PR authored or co-authored using generative AI tooling?
No