Add tests for FullTextPolicy multi-language support in Cosmos DB JS SDK#36953
Add tests for FullTextPolicy multi-language support in Cosmos DB JS SDK#36953
Conversation
Add unit and integration tests for FullTextPolicy with all supported languages: - GA Languages: en-US, fr-FR, de-DE, es-ES - Preview Languages: it-IT, pt-BR, pt-PT This is similar to the changes in azure-cosmos-dotnet-v3 PR #5515 Co-authored-by: topshot99 <113669638+topshot99@users.noreply.github.com>
- Replace fragile string contains checks with proper object assertions in unit tests - Add helper function for robust container name generation Co-authored-by: topshot99 <113669638+topshot99@users.noreply.github.com>
|
@copilot no need to create new file, there is an already exisiting one: feel free to add or update tests here, make sure to make minimal code changes |
Keep only integration tests in NonStreamingQueryPolicy.spec.ts as requested - no need for separate unit test file. Co-authored-by: topshot99 <113669638+topshot99@users.noreply.github.com>
Removed the separate unit test file. Tests are now only in |
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive test coverage for FullTextPolicy multi-language support in the Cosmos DB JavaScript SDK, aligning with the .NET SDK changes. The tests verify that the SDK correctly handles all supported language codes including GA languages (en-US, fr-FR, de-DE, es-ES) and preview languages (it-IT, pt-BR, pt-PT).
Changes:
- Added a nested test suite "FullTextPolicy multi-language support" within the existing "Full text search feature" test suite
- Implemented parameterized tests for all 7 supported languages
- Added tests for multiple paths with different languages
- Added dedicated tests for preview languages
|
@copilot skip this test with a comment that skipped until emulator supports it. |
Mark the FullTextPolicy multi-language support test suite as skipped with a comment explaining it's waiting for emulator support. Co-authored-by: topshot99 <113669638+topshot99@users.noreply.github.com>
|
@copilot can you remove these tests:
|
Removed the following tests: - should create container with FullTextPolicy using multiple paths with different languages - should create container with FullTextPolicy using preview languages Co-authored-by: topshot99 <113669638+topshot99@users.noreply.github.com>
Packages impacted by this PR
Issues associated with this PR
Describe the problem that is addressed by this PR
Adds test coverage for FullTextPolicy multi-language support, matching the .NET SDK changes in azure-cosmos-dotnet-v3#5515.
Supported languages:
Note: Tests are currently skipped until the emulator supports multi-language FullTextPolicy.
What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen?
The FullTextPolicy interface already supports language strings. This PR adds test coverage to verify the SDK correctly handles all supported language codes by extending the existing test file rather than creating new files.
Are there test cases added in this PR? (If not, why?)
Yes:
Integration tests (
test/public/functional/NonStreamingQueryPolicy.spec.ts):The tests are marked as skipped (
describe.skip) until the emulator supports the multi-language FullTextPolicy feature.Provide a list of related PRs (if any)
Command used to generate this PR:**(Applicable only to SDK release request PRs)
Checklists
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.