Skip to content

Add draft Sign Up V2 end-to-end tests (skipped pending test slice) - #3094

Draft
Sergei Demchenko (antrix1989) with Copilot wants to merge 2 commits into
spetrescu/native-auth-v2-signupfrom
copilot/spetrescunative-auth-v2-signup
Draft

Add draft Sign Up V2 end-to-end tests (skipped pending test slice)#3094
Sergei Demchenko (antrix1989) with Copilot wants to merge 2 commits into
spetrescu/native-auth-v2-signupfrom
copilot/spetrescunative-auth-v2-signup

Conversation

Copilot AI commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

V1 Sign Up E2E coverage had no V2 (server-driven) equivalent for the sign-up flow introduced in PR #3093. This adds the missing suites without duplicating or modifying the production Sign Up V2 logic.

Dependency: stacked on spetrescu/native-auth-v2-signup (PR #3093). Retarget to dev once #3093 merges.

New test suites

  • MSALNativeAuthSignUpUsernameV2EndToEndTests.swift — ports all 10 scenarios from V1's MSALNativeAuthSignUpUsernameEndToEndTests onto signUpV2(parameters:delegate:) / MSALNativeAuthSignUpParametersV2 and the unified V2 state machine (MSALNativeAuthCodeRequiredState, AttributesRequiredState/AttributesInvalidState, SignInAfterSignUpState).
  • MSALNativeAuthSignUpUsernameAndPasswordV2EndToEndTests.swift — ports all 12 scenarios from V1's MSALNativeAuthSignUpUsernameAndPasswordEndToEndTests.
  • SignUpDelegateSpiesV2.swift — new SignUpV2DelegateSpy conforming to the unified MSALNativeAuthFlowDelegate family (CodeRequired, AttributesRequired, AttributesInvalid, SignInAfterSignUpRequired), matching the existing SignInV2DelegateSpy pattern.

Coverage gaps

4 username+password scenarios (...FirstStepAndThenSetPassword..., ...andSetPasswordAfterOTP_success, ...FirstStepAndCustomAttributes..., ...FirstStepAndCustomAttributesOverMultipleScreens...) rely on a post-OTP "set password after verification" step that Sign Up V2 doesn't currently expose. These are kept and marked with // NOTE: comments, adapted to submit the password up front instead — resend-OTP, custom-attribute, and multi-screen coverage is preserved.

Execution

All tests are skipped via:

override func setUpWithError() throws {
    try super.setUpWithError()
    throw XCTSkip("Sign Up V2 requires a test slice. Disable this test until api/test slice is ready.")
}

Sign Up V2 requires a test slice not yet available, so nothing here executes; code was verified to compile against the real V2 API surface.

Project registration

MSAL.xcodeproj/project.pbxproj updated to register the new files under the same group/targets as the V1 sign-up files.

Original prompt

Implement draft Sign Up V2 end-to-end tests in AzureAD/microsoft-authentication-library-for-objc.

Follow the repository's .github/copilot-instructions.md strictly. Work from the current base branch, spetrescu/native-auth-v2-signup, which is the head branch of PR #3093 ("Native Auth V2 (server-driven): sign-up flow"). Do not reimplement or duplicate the production Sign Up V2 logic from that PR.

Objective

Create V2 equivalents of both existing V1 Sign Up E2E suites in one pull request:

  1. Existing V1 file:
    MSAL/test/integration/native_auth/end_to_end/sign_up/MSALNativeAuthSignUpUsernameEndToEndTests.swift

    New V2 file and class:
    MSAL/test/integration/native_auth/end_to_end/sign_up/MSALNativeAuthSignUpUsernameV2EndToEndTests.swift
    MSALNativeAuthSignUpUsernameV2EndToEndTests

  2. Existing V1 file:
    MSAL/test/integration/native_auth/end_to_end/sign_up/MSALNativeAuthSignUpUsernameAndPasswordEndToEndTests.swift

    New V2 file and class:
    MSAL/test/integration/native_auth/end_to_end/sign_up/MSALNativeAuthSignUpUsernameAndPasswordV2EndToEndTests.swift
    MSALNativeAuthSignUpUsernameAndPasswordV2EndToEndTests

Requirements

  • Preserve the corresponding V1 suites' scenario coverage, test intent, setup, and assertions while adapting each flow to the server-driven Sign Up V2 API supplied by PR Native Auth V2 (server-driven): sign-up flow #3093.
  • Use the established V2 integration-test patterns already present in the repository, especially:
    • MSALNativeAuthSignInUsernameV2EndToEndTests
    • MSALNativeAuthSignInUsernameAndPasswordV2EndToEndTests
    • MSALNativeAuthSignInWithMFAV2EndToEndTests
    • MSALNativeAuthResetPasswordV2EndToEndTests
  • Use appropriate V2 parameters, delegates, continuation states, expectations, error assertions, and Charly Firpo (@mainactor) annotations. Reuse existing helpers/spies when suitable; add narrowly scoped test-only helpers or delegate spies when needed.
  • Skip every test at the class level by overriding setUpWithError(), calling try super.setUpWithError(), and then throwing XCTSkip with a clear reason that Sign Up V2 requires a test slice and must remain disabled until that API/test slice is ready.
  • Even though class setup skips execution, all test code must compile against the PR Native Auth V2 (server-driven): sign-up flow #3093 branch and comply with repository Swift style and line-length rules.
  • Include the standard Microsoft MIT license header in both new files.
  • Ensure both files belong to the same integration-test target(s) as their V1 counterparts. Update MSAL/MSAL.xcodeproj/project.pbxproj only if explicit file/target registration is required by the existing project structure.
  • Keep this test-only: do not modify production behavior, do not remove or weaken V1 coverage, and do not add a changelog entry.
  • Do not execute the Sign Up E2E tests; they require a test slice unavailable in normal execution. Run only the smallest feasible non-E2E compliance checks, such as formatting, SwiftLint, or a compile/build check that does not execute these tests. Do not code sign local builds.

Pull request

Co-authored-by: antrix1989 <1989385+antrix1989@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement draft Sign Up V2 end-to-end tests Add draft Sign Up V2 end-to-end tests (skipped pending test slice) Aug 28, 2026
@@ -178,6 +178,9 @@
230967422711156A001B42D9 /* MSALTestsConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 230967402711156A001B42D9 /* MSALTestsConfig.m */; };

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This pull request does not update CHANGELOG.md.

Please consider if this change would be noticeable to a partner or user and either update CHANGELOG.md or resolve this conversation.

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.

2 participants