-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathsboms.ts
More file actions
37 lines (32 loc) · 1.22 KB
/
sboms.ts
File metadata and controls
37 lines (32 loc) · 1.22 KB
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
import { expect, test } from "../fixtures";
import {
testBasicSort,
validateDateSorting,
validateStringSorting,
} from "../helpers/sorting-helpers";
test.skip("List first 10 sboms by name - vanilla", async ({ axios }) => {
const vanillaResponse = await axios.get(
"/api/v2/sbom?limit=10&offset=0&sort=name:asc",
);
expect(vanillaResponse.data).toEqual(
expect.objectContaining({
total: 6,
}),
);
});
test("Sort SBOMs by name ascending", async ({ axios }) => {
const items = await testBasicSort(axios, "/api/v2/sbom", "name", "asc");
validateStringSorting(items, "name", "ascending");
});
test("Sort SBOMs by name descending", async ({ axios }) => {
const items = await testBasicSort(axios, "/api/v2/sbom", "name", "desc");
validateStringSorting(items, "name", "descending");
});
test("Sort SBOMs by published date ascending", async ({ axios }) => {
const items = await testBasicSort(axios, "/api/v2/sbom", "published", "asc");
validateDateSorting(items, "published", "ascending");
});
test("Sort SBOMs by published date descending", async ({ axios }) => {
const items = await testBasicSort(axios, "/api/v2/sbom", "published", "desc");
validateDateSorting(items, "published", "descending");
});