forked from MrRefactoring/jira.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprojects.test.ts
39 lines (30 loc) · 1 KB
/
projects.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
30
31
32
33
34
35
36
37
38
39
import { afterAll, beforeAll, test } from 'vitest';
import { Constants } from '@tests/integration/constants';
import {
cleanupEnvironment,
getVersion2Client,
getVersion3Client,
prepareEnvironment,
} from '@tests/integration/utils';
beforeAll(async () => {
await prepareEnvironment();
});
afterAll(async () => {
await cleanupEnvironment();
});
test.sequential('should search all projects', async ({ expect }) => {
const client = getVersion2Client();
const projects = await client.projects.searchProjects();
expect(projects.total).toBe(1);
});
test.sequential(`should search ${Constants.testProjectKey} project`, async ({ expect }) => {
const client = getVersion3Client();
const projects = await client.projects.searchProjects({
query: Constants.testProjectKey,
});
expect(projects.total).toBe(1);
expect(projects.isLast).toBeTruthy();
const project = projects.values[0];
expect(project.key).toBe(Constants.testProjectKey);
expect(project.name).toBe(Constants.testProjectName);
});