Skip to content

[PM-44990] Build Policy test fixtures from PolicyData in auth - #24208

Merged
eliykat merged 1 commit into
ac/pm-44990/sdk-policy-consumers-toolsfrom
ac/pm-44990/sdk-policy-consumers-auth
Oct 29, 2026
Merged

eliykat merged 1 commit into
ac/pm-44990/sdk-policy-consumers-toolsfrom
ac/pm-44990/sdk-policy-consumers-auth

Conversation

@eliykat

@eliykat eliykat commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-44990

📔 Objective

Build Policy test fixtures by passing a full PolicyData to the constructor, instead of calling new Policy() and setting properties afterwards. Covers the browser account security, desktop settings dialog and web login component specs. The emergency access spec now checks the real result of mapping an SDK policy, instead of spying on Policy.fromSdkPolicy.

This prepares for #24086, which makes the Policy constructor argument required. These changes already work with the current Policy, so this PR can merge first.

📸 Screenshots

N/A

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

This PR changes only tests, in four spec files: browser account security, desktop settings dialog, web login component service, and emergency access service. Each Policy fixture is now built from a full PolicyData-shaped object, and that object supplies every field the Policy constructor maps, so these tests will still compile once #24086 makes the constructor argument required. The emergency access test no longer spies on Policy.fromSdkPolicy. It now runs the real mapping through the SDK branch of getGrantorPolicies and checks the UUID round-trip, the JSON data parsing and the revisionDate conversion. No production code changed, and there are no findings.

@eliykat
eliykat marked this pull request as ready for review October 28, 2026 03:40
@eliykat
eliykat requested a review from a team as a code owner October 28, 2026 03:40
@eliykat
eliykat enabled stacked auto-merge (squash) October 28, 2026 03:40
@codecov

codecov Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.04%. Comparing base (ada8885) to head (ed49961).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@                            Coverage Diff                             @@
##           ac/pm-44990/sdk-policy-consumers-tools   #24208      +/-   ##
==========================================================================
- Coverage                                   61.05%   61.04%   -0.01%     
==========================================================================
  Files                                        4872     4872              
  Lines                                      156188   156188              
  Branches                                    25000    25000              
==========================================================================
- Hits                                        95353    95348       -5     
- Misses                                      54303    54308       +5     
  Partials                                     6532     6532              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@eliykat
eliykat force-pushed the ac/pm-44990/sdk-policy-consumers-auth branch from 8c12f48 to 1446a55 Compare October 28, 2026 23:15
@eliykat
eliykat disabled stacked auto-merge October 28, 2026 23:53
@eliykat
eliykat force-pushed the ac/pm-44990/sdk-policy-consumers-auth branch from 1446a55 to ed49961 Compare October 29, 2026 20:53

@JaredSnider-Bitwarden JaredSnider-Bitwarden left a comment

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.

LGTM!

@eliykat
eliykat enabled stacked auto-merge (squash) October 29, 2026 21:04
@eliykat
eliykat merged commit ef12d93 into main Oct 29, 2026
130 of 131 checks passed
@eliykat
eliykat deleted the ac/pm-44990/sdk-policy-consumers-auth branch October 29, 2026 21:21
@djsmith85 djsmith85 added browser Browser Extension desktop Desktop Application web labels Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Request a Claude code review browser Browser Extension desktop Desktop Application t:tech-debt Change Type - Tech debt web

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants