Skip to content

Add tests for FullTextPolicy multi-language support in Cosmos DB JS SDK#36953

Open
Copilot wants to merge 6 commits intomainfrom
copilot/add-language-support-tests
Open

Add tests for FullTextPolicy multi-language support in Cosmos DB JS SDK#36953
Copilot wants to merge 6 commits intomainfrom
copilot/add-language-support-tests

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 2, 2026

Packages impacted by this PR

  • @azure/cosmos

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:

  • GA: en-US, fr-FR, de-DE, es-ES
  • Preview: it-IT, pt-BR, pt-PT

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):

  • Parameterized container creation tests with FullTextPolicy for each supported language (en-US, fr-FR, de-DE, es-ES, it-IT, pt-BR, pt-PT)

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

  • Added impacted package name to the issue description
  • Does this PR needs any fixes in the SDK Generator?** (If so, create an Issue in the Autorest/typescript repository and link it here)
  • Added a changelog (if necessary)
Original prompt

I want u to do similar changes in comos db JS SDK:
Azure/azure-cosmos-dotnet-v3#5515

basically its about supprot of new languages
For GA -> French, German, Spanish
New Preview Languages -> Italian, Portuguese, Portuguese Brazilian

mostly the field is there u need to add some test cases to verify it


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits January 2, 2026 11:13
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 AI changed the title [WIP] Add test cases for new language support in Cosmos DB SDK Add tests for FullTextPolicy multi-language support in Cosmos DB JS SDK Jan 2, 2026
Copilot AI requested a review from topshot99 January 2, 2026 11:20
@topshot99
Copy link
Copy Markdown
Member

@copilot no need to create new file, there is an already exisiting one:
C:\Users\mkhandelwal\azure-sdk-for-js\sdk\cosmosdb\cosmos\test\public\functional\NonStreamingQueryPolicy.spec.ts

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>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jan 5, 2026

@copilot no need to create new file, there is an already exisiting one:
C:\Users\mkhandelwal\azure-sdk-for-js\sdk\cosmosdb\cosmos\test\public\functional\NonStreamingQueryPolicy.spec.ts
...

Removed the separate unit test file. Tests are now only in NonStreamingQueryPolicy.spec.ts as requested. (7ccae4b)

@topshot99 topshot99 marked this pull request as ready for review January 12, 2026 08:52
Copilot AI review requested due to automatic review settings January 12, 2026 08:52
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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

@topshot99
Copy link
Copy Markdown
Member

@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>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jan 12, 2026

@copilot skip this test with a comment that skipped until emulator supports it.

Done. Marked the test suite with describe.skip and added a comment "Skipped until emulator supports it." (456bb96)

@topshot99
Copy link
Copy Markdown
Member

@copilot can you remove these tests:

  1. should create container with FullTextPolicy using multiple paths with different languages
  2. should create container with FullTextPolicy using preview languages

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>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jan 29, 2026

@copilot can you remove these tests:

  1. should create container with FullTextPolicy using multiple paths with different languages
  2. should create container with FullTextPolicy using preview languag...

Removed both tests. (dc0bfc1)

@topshot99 topshot99 enabled auto-merge (squash) January 29, 2026 11:36
@topshot99 topshot99 disabled auto-merge January 29, 2026 11:48
@topshot99 topshot99 enabled auto-merge (squash) January 29, 2026 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants