Skip to content

Commit

Permalink
fix disable workflows case
Browse files Browse the repository at this point in the history
  • Loading branch information
twilight2294 authored Mar 9, 2025
1 parent 15950fe commit c8a148f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/libs/actions/Policy/Policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3160,7 +3160,7 @@ function enablePolicyWorkflows(policyID: string, enabled: boolean) {
? {
approvalMode: CONST.POLICY.APPROVAL_MODE.OPTIONAL,
autoReporting: false,
autoReportingFrequency: CONST.POLICY.AUTO_REPORTING_FREQUENCIES.IMMEDIATE,
autoReportingFrequency: CONST.POLICY.AUTO_REPORTING_FREQUENCIES. INSTANT,
harvesting: {
enabled: false,
},
Expand Down
4 changes: 2 additions & 2 deletions tests/actions/PolicyTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ describe('actions/Policy', () => {
});

describe('enablePolicyWorkflows', () => {
it('should update delayed submission to immediate when disabling the workflows feature', async () => {
it('should update delayed submission to instant when disabling the workflows feature', async () => {
(fetch as MockFetch)?.pause?.();
Onyx.set(ONYXKEYS.SESSION, {email: ESH_EMAIL, accountID: ESH_ACCOUNT_ID});
const fakePolicy: PolicyType = {
Expand All @@ -587,7 +587,7 @@ describe('actions/Policy', () => {
callback: (policy) => {
// Check if the autoReportingFrequency is updated to instant
expect(policy?.areWorkflowsEnabled).toBeFalsy();
expect(policy?.autoReportingFrequency).toBe(CONST.POLICY.AUTO_REPORTING_FREQUENCIES.IMMEDIATE);
expect(policy?.autoReportingFrequency).toBe(CONST.POLICY.AUTO_REPORTING_FREQUENCIES.INSTANT);
},
});
});
Expand Down

0 comments on commit c8a148f

Please sign in to comment.