Skip to content

Commit 221acc0

Browse files
committed
fix missing param
1 parent 07e71f0 commit 221acc0

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

tests/actions/PolicyTest.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -823,11 +823,12 @@ describe('actions/Policy', () => {
823823
it("should remove all non-owned workspace chats and keep the user's own workspace chat when leaving a workspace", async () => {
824824
await Onyx.set(ONYXKEYS.SESSION, {email: ESH_EMAIL, accountID: ESH_ACCOUNT_ID});
825825
const policyID = Policy.generatePolicyID();
826-
await Onyx.set(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`, {
826+
const policy: PolicyType = {
827827
...createRandomPolicy(0, CONST.POLICY.TYPE.TEAM),
828828
id: policyID,
829829
name: WORKSPACE_NAME,
830-
});
830+
};
831+
await Onyx.set(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`, policy);
831832
await waitForBatchedUpdates();
832833

833834
const ownWorkspaceChat: Report = {
@@ -856,7 +857,7 @@ describe('actions/Policy', () => {
856857
const getAllWorkspaceReportsSpy = jest.spyOn(ReportUtils, 'getAllWorkspaceReports').mockReturnValue([ownWorkspaceChat, ...nonOwnedWorkspaceChats]);
857858
const apiWriteSpy = jest.spyOn(require('@libs/API'), 'write').mockImplementation(() => Promise.resolve());
858859

859-
Policy.leaveWorkspace(ESH_ACCOUNT_ID, policyID);
860+
Policy.leaveWorkspace(ESH_ACCOUNT_ID, policy);
860861
await waitForBatchedUpdates();
861862

862863
expect(apiWriteSpy).toHaveBeenCalledWith(
@@ -1943,7 +1944,7 @@ describe('actions/Policy', () => {
19431944
await Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${report.reportID}`, report);
19441945

19451946
// When leaveWorkspace is called
1946-
Policy.leaveWorkspace(policy);
1947+
Policy.leaveWorkspace(1, policy);
19471948

19481949
await waitForBatchedUpdates();
19491950

0 commit comments

Comments
 (0)