forked from Expensify/App
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PolicyUtils.perf-test.ts
29 lines (25 loc) · 1.14 KB
/
PolicyUtils.perf-test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import {measureFunction} from 'reassure';
import {getMemberAccountIDsForWorkspace} from '@libs/PolicyUtils';
import createCollection from '../utils/collections/createCollection';
import createRandomPolicyEmployeeList from '../utils/collections/policyEmployeeList';
describe('PolicyUtils', () => {
describe('getMemberAccountIDsForWorkspace', () => {
test('500 policy members with personal details', async () => {
const policyEmployeeList = createCollection(
(_, index) => index,
() => createRandomPolicyEmployeeList(),
);
await measureFunction(() => getMemberAccountIDsForWorkspace(policyEmployeeList));
});
test('500 policy members with errors and personal details', async () => {
const policyEmployeeList = createCollection(
(_, index) => index,
() => ({
...createRandomPolicyEmployeeList(),
errors: {error: 'Error message'},
}),
);
await measureFunction(() => getMemberAccountIDsForWorkspace(policyEmployeeList));
});
});
});