Skip to content

VSP-1688: Add unit tests for ShareItemGrantAndInviteViewModel#561

Closed
sergiu-tnv wants to merge 1 commit into
Developmentfrom
feature/VSP-1688-grant-access-view-model-unit-tests
Closed

VSP-1688: Add unit tests for ShareItemGrantAndInviteViewModel#561
sergiu-tnv wants to merge 1 commit into
Developmentfrom
feature/VSP-1688-grant-access-view-model-unit-tests

Conversation

@sergiu-tnv
Copy link
Copy Markdown

Story

VSP-1688 — [IOS][Mobile][UnitTests] grant access ViewModel

App Specs references

  • REQ-SHARE-001: Grant and Invite Access to Shared Items

Changes

  • Add ShareItemGrantAndInviteViewModelTests.swift with 26 unit tests covering the grant/invite extension on ShareItemViewModel

Test groups:

  • Find Archive by Email navigation (openFindArchiveByEmail, closeFindArchiveByEmail)
  • Select Archive from Past Shares navigation
  • Grant Archive Access flow — open/close routing, local submit path (nil archiveID), update-existing-archive, no-op guard
  • Invite and Grant Access flow — email/name state, role reset, close routing, blank-email guard, no-session guard
  • Archive Access Management — updateArchiveAccessRole and revokeArchiveAccess (nil shareID error path + success path)
  • Legacy email invitation (sendEmailInvitation, submitEmailInvitation)

Test evidence

  • Unit tests: to be verified locally (bundle exec fastlane tests)
  • Test cases: TC-001, TC-002, TC-003, TC-004, TC-005
  • E2E: n/a

Checklist

  • Acceptance criteria met
  • Tests passing (requires sudo xcode-select -s /Applications/Xcode.app/Contents/Developer then bundle exec fastlane tests)
  • No debug code
  • EnvVars.generated.swift not modified

🤖 Generated with Claude Code

Covers navigation state transitions, local grant submission path,
update/revoke archive access via repository mock, invite flow guards,
and legacy email invitation helpers.

VSP-1688 // REQ-SHARE-001

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@luciancerbu-vsp
Copy link
Copy Markdown
Contributor

These unit tests were not prepared for the current Share and Publish branch. We have a lot of modifications on the view models that were tested in the current branch.

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