Skip to content

Add missing UI Tests.#2901

Merged
brandonpage merged 2 commits into
forcedotcom:devfrom
brandonpage:missing-ui-tests
May 27, 2026
Merged

Add missing UI Tests.#2901
brandonpage merged 2 commits into
forcedotcom:devfrom
brandonpage:missing-ui-tests

Conversation

@brandonpage
Copy link
Copy Markdown
Contributor

Test plan ID: MU-03

Gap: Server-side revocation of a non-current user's refresh token must auto-log-out only that user, leave the primary user's tokens & session intact. Surfaced two SDK gaps: (a) currentUser cleared on one-of-N logout instead of falling back to a remaining user; (b) LOGOUT_COMPLETE_INTENT_ACTION fires while isLoggingOut = true, so receivers calling peekRestClient immediately throw.

New test (file: method): MultiUserLoginTests.kt :: testMultiUser_revokeOtherUserRefreshToken


Test plan ID: NEG-Ø1

Gap: Login with a malformed consumer key in a dynamic config must fail and create no user account. Surfaced SDK gap: debugOverrideAppConfig only cleared on the success path, so an aborted login leaks the override into the next session/test.

New test (file: method): NegativeLoginTests.kt :: testInvalidConsumerKey_loginFails


Test plan ID: NEG-Ø2

Gap: Login with an unknown scope in a dynamic config must fail and create no user account. Same debugOverrideAppConfig leak.

New test (file: method): NegativeLoginTests.kt :: testInvalidScope_loginFails


Test plan ID: NEG-03

Gap: Saving a different dynamic config in Login Options and backing out without logging in must not affect the existing user's tokens, config, or refresh capability. Same debugOverrideAppConfig leak.

New test (file: method): NegativeLoginTests.kt :: testChangeDynamicConfigWithoutLogin_existingUserUnaffected


Test plan ID: 2.7

Gap: Migrate CA-Basic (user-agent flow source) → ECA-Extended (web-server flow target). Validates new tokens are issued, the original user/scopes are preserved, and refresh works on the new app.

New test (file: method): RefreshTokenMigrationTests.kt :: testMigrateCAUserAgent_To_ECAExtendedWebServer


Test plan ID: 2.8

Gap: Migrate CA-Basic (user-agent flow source) → Beacon-Extended (web-server flow target). Same expectations as 2.7 but targeting the Beacon ECA.

New test (file: method): RefreshTokenMigrationTests.kt :: testMigrateCAUserAgent_To_BeaconExtendedWebServer


Supporting infrastructure

Added alongside (not new test cases, but referenced by the tests above): AuthFlowTesterPageObject.triggerApiRequestIgnoringResult, clickAndWaitForAlert retry helper, LOGOUT_COMPLETE_INTENT_ACTION subscription with one-of-N fallback in AuthFlowTesterActivity, and migrateRefreshToken_passesUseWebServerFlowFromOAuthConfig-style override plumbing exercised by the migration tests.


@codecov
Copy link
Copy Markdown

codecov Bot commented May 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.07%. Comparing base (b9411ff) to head (d745c94).
⚠️ Report is 10 commits behind head on dev.

Additional details and impacted files
@@             Coverage Diff              @@
##                dev    #2901      +/-   ##
============================================
- Coverage     55.17%   55.07%   -0.10%     
+ Complexity     2509     2507       -2     
============================================
  Files           226      226              
  Lines         17781    17774       -7     
  Branches       2328     2327       -1     
============================================
- Hits           9810     9789      -21     
- Misses         6966     6980      +14     
  Partials       1005     1005              
Components Coverage Δ
Analytics 48.71% <ø> (ø)
SalesforceSDK 41.72% <88.88%> (-0.19%) ⬇️
Hybrid 59.30% <ø> (ø)
SmartStore 78.22% <ø> (ø)
MobileSync 82.12% <ø> (ø)
React 51.50% <ø> (ø)
see 3 files with indirect coverage changes
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@JohnsonEricAtSalesforce JohnsonEricAtSalesforce left a comment

Choose a reason for hiding this comment

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

👍🏻

}
}

val deadline = System.currentTimeMillis() + LOGIN_FAILURE_SETTLE_MS
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Couldn't you use waitForUserCount here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@wmathurin I don't think so, they do opposite things. waitForUserCount waits until the desired user count is hit and breaks out asap. The code here is waiting the entire timeout to ensure a user is not added.

@brandonpage brandonpage merged commit fdb090a into forcedotcom:dev May 27, 2026
30 of 35 checks passed
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.

3 participants