Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add unit test for chat history page #55

Conversation

wanglam
Copy link
Collaborator

@wanglam wanglam commented Dec 8, 2023

Description

  1. Set sessions status to loading during sessions load
  2. Add unit tests for chat history page

Issues Resolved

List any issues this PR will resolve, e.g. Closes [...].

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@wanglam wanglam force-pushed the feat-add-chat-history-page-ut branch from 12e19c4 to b9f07db Compare December 8, 2023 03:55
@wanglam wanglam marked this pull request as ready for review December 8, 2023 03:56
Copy link

codecov bot commented Dec 8, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c70bcfc) 48.75% compared to head (428c0d7) 58.99%.
Report is 3 commits behind head on feature/agent-framework.

Additional details and impacted files
@@                     Coverage Diff                      @@
##           feature/agent-framework      #55       +/-   ##
============================================================
+ Coverage                    48.75%   58.99%   +10.23%     
============================================================
  Files                           46       46               
  Lines                         1087     1090        +3     
  Branches                       250      251        +1     
============================================================
+ Hits                           530      643      +113     
+ Misses                         548      440      -108     
+ Partials                         9        7        -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ruanyl ruanyl changed the title test: add unit test for chst history page test: add unit test for chat history page Dec 8, 2023
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
@wanglam wanglam force-pushed the feat-add-chat-history-page-ut branch from b9f07db to 52e5ab5 Compare December 11, 2023 06:16
);

expect(onChatHistoryTitleClickMock).not.toHaveBeenCalled();
act(() => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these act necessary in these cases? I thought we only need act when the operation causes state change which end up with updating the component tree.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with you. The act is unnecessary here. Will remove them.

Signed-off-by: Lin Wang <wonglam@amazon.com>
@wanglam wanglam merged commit 634053e into opensearch-project:feature/agent-framework Dec 13, 2023
10 checks passed
joshuali925 pushed a commit to joshuali925/dashboards-assistant that referenced this pull request Dec 13, 2023
* test: add unit test for chst history page

Signed-off-by: Lin Wang <wonglam@amazon.com>

* test: add unit tests for chat history list

Signed-off-by: Lin Wang <wonglam@amazon.com>

* test: add unit tests for chat history search list

Signed-off-by: Lin Wang <wonglam@amazon.com>

* test: remove unnecessary act

Signed-off-by: Lin Wang <wonglam@amazon.com>

---------

Signed-off-by: Lin Wang <wonglam@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants