Skip to content

fix: fix document test #310

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

Merged
merged 4 commits into from
Mar 24, 2025
Merged

fix: fix document test #310

merged 4 commits into from
Mar 24, 2025

Conversation

Shreyas-Microsoft
Copy link

@Shreyas-Microsoft Shreyas-Microsoft commented Mar 24, 2025

Purpose

This pull request includes several updates to the unit tests for various components in the frontend. The changes primarily focus on improving the accuracy and reliability of the tests by adding new mock implementations and adjusting existing test cases.

Improvements to ChatHistoryListItem tests:

  • Added historyRead to the list of mocked API functions in chatHistoryListItem.test.tsx. [1] [2]
  • Updated test cases to include new scenarios and ensure the onSelect handler is called with the correct data, including messages fetched via historyRead. [1] [2]

Improvements to Chat component tests:

  • Replaced nonDelayedhistoryGenerateAPIcallMock with a more precise mock implementation to simulate expected errors.
  • Removed unnecessary act wrapper around userEvent.click in the test for handling non-existent chat items.

Improvements to Document component tests:

  • Adjusted the test to check for mockDocumentData.content instead of mockDocumentData.full_content to ensure the correct data is being validated.

Improvements to Draft component tests:

  • Added await waitFor to ensure the test waits for the asynchronous rendering of SectionCard components.

Does this introduce a breaking change?

  • Yes
  • No

Golden Path Validation

  • I have tested the primary workflows (the "golden path") to ensure they function correctly without errors.

Deployment Validation

  • I have validated the deployment process successfully and all services are running as expected with this change.

What to Check

Verify that the following are valid

  • I have built and tested the code locally and in a deployed app
  • For frontend changes, I have pulled the latest code from main, built the frontend, and committed all static files.
  • This is a change for all users of this app. No code or asset is specific to my use case or my organization.

Other Information

@Shreyas-Microsoft Shreyas-Microsoft changed the title fix document test fix: fix document test Mar 24, 2025
@Roopan-Microsoft Roopan-Microsoft merged commit 2532308 into main Mar 24, 2025
10 of 12 checks passed
@Shreyas-Microsoft Shreyas-Microsoft deleted the psl-testFixes branch April 3, 2025 12:09
Copy link

github-actions bot commented Apr 5, 2025

🎉 This PR is included in version 1.1.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants