-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Show Manager McTest as recipient for eligible users #56364
Merged
grgia
merged 7 commits into
Expensify:main
from
callstack-internal:show-manager-mctest-as-recipient-for-eligible-users
Feb 11, 2025
+58
−0
Merged
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
96f9177
add check for displaying Manager McTest as recipeint
kubabutkiewicz cbc2279
add tests
kubabutkiewicz 6abe419
improve naming
kubabutkiewicz b739ddb
Merge branch 'main' of github.com:callstack-internal/Expensify-App in…
kubabutkiewicz 0664f7e
fix tests
kubabutkiewicz 9b0878d
add option to config to show manager mc test
kubabutkiewicz 0a9fbea
Merge branch 'main' of github.com:callstack-internal/Expensify-App in…
kubabutkiewicz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -457,6 +457,15 @@ describe('OptionsListUtils', () => { | |
}, | ||
}; | ||
|
||
const PERSONAL_DETAILS_WITH_MANAGER_MCTEST: PersonalDetailsList = { | ||
...PERSONAL_DETAILS, | ||
'1003': { | ||
accountID: 1003, | ||
displayName: 'Manager McTest', | ||
login: CONST.EMAIL.MANAGER_MCTEST, | ||
reportID: '', | ||
}, | ||
}; | ||
const policyID = 'ABC123'; | ||
|
||
const POLICY: Policy = { | ||
|
@@ -487,6 +496,8 @@ describe('OptionsListUtils', () => { | |
}, | ||
[`${ONYXKEYS.COLLECTION.POLICY}${policyID}` as const]: POLICY, | ||
[ONYXKEYS.NVP_ACTIVE_POLICY_ID]: activePolicyID, | ||
[ONYXKEYS.NVP_DISMISSED_PRODUCT_TRAINING]: {}, | ||
[ONYXKEYS.BETAS]: [CONST.BETAS.NEWDOT_MANAGER_MCTEST], | ||
}, | ||
}); | ||
Onyx.registerLogger(() => {}); | ||
|
@@ -498,6 +509,7 @@ describe('OptionsListUtils', () => { | |
let OPTIONS_WITH_CHRONOS: OptionsListUtils.OptionList; | ||
let OPTIONS_WITH_RECEIPTS: OptionsListUtils.OptionList; | ||
let OPTIONS_WITH_WORKSPACE_ROOM: OptionsListUtils.OptionList; | ||
let OPTIONS_WITH_MANAGER_MCTEST: OptionsListUtils.OptionList; | ||
|
||
beforeEach(() => { | ||
Onyx.set(`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}10`, reportNameValuePairs); | ||
|
@@ -506,6 +518,7 @@ describe('OptionsListUtils', () => { | |
OPTIONS_WITH_CHRONOS = OptionsListUtils.createOptionList(PERSONAL_DETAILS_WITH_CHRONOS, REPORTS_WITH_CHRONOS); | ||
OPTIONS_WITH_RECEIPTS = OptionsListUtils.createOptionList(PERSONAL_DETAILS_WITH_RECEIPTS, REPORTS_WITH_RECEIPTS); | ||
OPTIONS_WITH_WORKSPACE_ROOM = OptionsListUtils.createOptionList(PERSONAL_DETAILS, REPORTS_WITH_WORKSPACE_ROOMS); | ||
OPTIONS_WITH_MANAGER_MCTEST = OptionsListUtils.createOptionList(PERSONAL_DETAILS_WITH_MANAGER_MCTEST); | ||
}); | ||
|
||
it('getSearchOptions()', () => { | ||
|
@@ -621,6 +634,23 @@ describe('OptionsListUtils', () => { | |
// Filtering of personalDetails that have reports is done in filterOptions | ||
expect(results.personalDetails.length).toBe(Object.values(OPTIONS_WITH_RECEIPTS.personalDetails).length - 2); | ||
expect(results.personalDetails).not.toEqual(expect.arrayContaining([expect.objectContaining({login: '[email protected]'})])); | ||
|
||
// Test for check if Manager McTest is correctly included or excluded from the results | ||
const options = OptionsListUtils.getValidOptions( | ||
{reports: OPTIONS_WITH_MANAGER_MCTEST.reports, personalDetails: OPTIONS_WITH_MANAGER_MCTEST.personalDetails}, | ||
{includeP2P: true, action: 'create'}, | ||
); | ||
expect(options.personalDetails).toEqual(expect.arrayContaining([expect.objectContaining({login: CONST.EMAIL.MANAGER_MCTEST})])); | ||
|
||
return waitForBatchedUpdates() | ||
.then(() => Onyx.set(ONYXKEYS.NVP_DISMISSED_PRODUCT_TRAINING, {[CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.SCAN_TEST_TOOLTIP]: new Date() as unknown as string})) | ||
.then(() => { | ||
const optionsWhenUserAlreadySubmittedExpense = OptionsListUtils.getValidOptions( | ||
{reports: OPTIONS_WITH_MANAGER_MCTEST.reports, personalDetails: OPTIONS_WITH_MANAGER_MCTEST.personalDetails}, | ||
{includeP2P: true, action: 'create'}, | ||
); | ||
expect(optionsWhenUserAlreadySubmittedExpense.personalDetails).not.toEqual(expect.arrayContaining([expect.objectContaining({login: CONST.EMAIL.MANAGER_MCTEST})])); | ||
}); | ||
}); | ||
|
||
it('getValidOptions() for group Chat', () => { | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I think we should introduce a new prop as includeMCTest instead of using config.action to detect which place should be allowed to display Manager MCtest
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.
Fixed @DylanDylann