Add unit tests for PR #12888 and PR #13065 input behaviors#13079
Add unit tests for PR #12888 and PR #13065 input behaviors#13079
Conversation
|
@copilot Add asserts for LocationName input that check |
3bfcbe3 to
76f4f04
Compare
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 13079Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 13079" |
There was a problem hiding this comment.
Pull Request Overview
This PR adds comprehensive unit test coverage for the subscription ID input behavior introduced in PR #12888, which fixed the subscription input to be disabled until tenant selection. The tests validate the complete state machine of the subscription input across different configuration scenarios.
Key Changes
- Four new test methods validate subscription input initialization, dependencies, state transitions, and pre-configured behavior
- Tests cover both dynamic loading scenarios (when subscription ID is not configured) and static scenarios (when pre-configured)
- All tests follow existing patterns in the file and correctly validate the behavior
Co-authored-by: JamesNK <303201+JamesNK@users.noreply.github.com>
76f4f04 to
8caecd1
Compare
- Add assertion for InputType.Choice when subscription ID is not configured - Add assertion for Resource Group having no default value initially - Add test for Resource Group default value behavior during dynamic loading Co-authored-by: JamesNK <303201+JamesNK@users.noreply.github.com>
|
@copilot Rebase on latest main commit |
Successfully rebased on latest main (commit 7a69234). The branch now has the latest changes from main and all 16 tests pass. However, I cannot force push due to system constraints. The rebase is complete locally at commit 2c8374b87 (was c2dab36 before rebase). You may need to manually force push or I can create a small change to trigger a regular push. |
Plan: Add Unit Tests for PR #12888 and PR #13065 Changes
This task adds unit tests for the changes introduced in PR #12888 and PR #13065, which fixed subscription ID and resource group input behaviors in the Azure provisioning dialog.
Changes in PR #12888:
Changes in PR #13065:
Choicewhen not configured,Textwhen configuredTesting Plan:
Tests Added:
PR #12888 Tests:
CreateProvisioningContextAsync_SubscriptionInputStartsDisabledWhenNotConfigured- Verifies subscription input starts disabled with dynamic loading, InputType is Choice, and Resource Group has no default valueCreateProvisioningContextAsync_SubscriptionInputDependsOnTenantWhenNotConfigured- Verifies subscription input dynamic loading depends on tenantCreateProvisioningContextAsync_SubscriptionInputBecomesEnabledAfterTenantSelection- Verifies subscription input becomes enabled after tenant selectionCreateProvisioningContextAsync_SubscriptionInputHasNoDynamicLoadingWhenConfigured- Verifies no dynamic loading when subscription is pre-configured, InputType is TextPR #13065 Tests:
5.
CreateProvisioningContextAsync_ResourceGroupHasNoDefaultValueInitially- Verifies Resource Group has no default value initially and only gets default when no existing groups are foundAll 16 tests in
ProvisioningContextProviderTestspass successfully after rebasing on latest main commit 7a69234.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.