-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Refactor: Deprecate getPolicy (part 8) #81560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor: Deprecate getPolicy (part 8) #81560
Conversation
|
@ikevin127 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
PR doesn’t need product input as a refactor PR. Unassigning and unsubscribing myself. |
Reviewer Checklist
Screenshots/VideosScreen.Recording.2026-02-06.at.16.55.01.mov |
ikevin127
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟢 LGTM - Completed PR Reviewer Checklist. Didn't find any code / manual testing issues ✅
📊 Test Coverage Assessment
Current Test Coverage: 0% for the specific changes
Files checked:
tests/unit/PolicyUtilsTest.ts- No tests forcanSendInvoiceFromWorkspacetests/actions/PolicyTest.ts- No tests for invoice-related functions
NAB - Recommendation: While the function is simple (return policy?.areInvoicesEnabled ?? false), consider adding a unit test to validate the behavior:
// Suggested test in PolicyUtilsTest.ts
describe('canSendInvoiceFromWorkspace', () => {
it('returns true when areInvoicesEnabled is true', () => {
const policy = { areInvoicesEnabled: true } as Policy;
expect(canSendInvoiceFromWorkspace(policy)).toBe(true);
});
it('returns false when areInvoicesEnabled is false', () => {
const policy = { areInvoicesEnabled: false } as Policy;
expect(canSendInvoiceFromWorkspace(policy)).toBe(false);
});
it('returns false when policy is undefined', () => {
expect(canSendInvoiceFromWorkspace(undefined)).toBe(false);
});
});|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Explanation of Change
Fixed Issues
$ #66397
Tests
Pre-requisite - Have at least one workspace with invoice feature enabled.
Offline tests
Same as Tests
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Screen.Recording.2026-02-05.at.9.58.34.PM.mov