Lines 8-38
const dates = {
Link Here
|
8 |
tomorrow_iso: dayjs().add(1, "day").format("YYYY-MM-DD"), |
8 |
tomorrow_iso: dayjs().add(1, "day").format("YYYY-MM-DD"), |
9 |
tomorrow_us: dayjs().add(1, "day").format("MM/DD/YYYY"), |
9 |
tomorrow_us: dayjs().add(1, "day").format("MM/DD/YYYY"), |
10 |
}; |
10 |
}; |
11 |
function get_license() { |
|
|
12 |
return { |
13 |
license_id: 1, |
14 |
name: "license 1", |
15 |
description: "my first license", |
16 |
type: "local", |
17 |
status: "active", |
18 |
started_on: dates["today_iso"], |
19 |
ended_on: dates["tomorrow_iso"], |
20 |
user_roles: [], |
21 |
vendor_id: 1, |
22 |
vendor: [cy.get_vendors_to_relate()[0]], |
23 |
documents: [ |
24 |
{ |
25 |
license_id: 1, |
26 |
file_description: "file description", |
27 |
file_name: "file.json", |
28 |
notes: "file notes", |
29 |
physical_location: "file physical location", |
30 |
uri: "file uri", |
31 |
uploaded_on: "2022-10-27T11:57:02+00:00", |
32 |
}, |
33 |
], |
34 |
}; |
35 |
} |
36 |
|
11 |
|
37 |
describe("License CRUD operations", () => { |
12 |
describe("License CRUD operations", () => { |
38 |
beforeEach(() => { |
13 |
beforeEach(() => { |
Lines 62-68
describe("License CRUD operations", () => {
Link Here
|
62 |
cy.get("#licenses_list").contains("There are no licenses defined"); |
37 |
cy.get("#licenses_list").contains("There are no licenses defined"); |
63 |
|
38 |
|
64 |
// GET licenses returns something |
39 |
// GET licenses returns something |
65 |
let license = get_license(); |
40 |
let license = cy.get_license(); |
66 |
let licenses = [license]; |
41 |
let licenses = [license]; |
67 |
|
42 |
|
68 |
cy.intercept("GET", "/api/v1/erm/licenses*", { |
43 |
cy.intercept("GET", "/api/v1/erm/licenses*", { |
Lines 79-85
describe("License CRUD operations", () => {
Link Here
|
79 |
}); |
54 |
}); |
80 |
|
55 |
|
81 |
it("Add license", () => { |
56 |
it("Add license", () => { |
82 |
let license = get_license(); |
57 |
let license = cy.get_license(); |
83 |
let vendors = cy.get_vendors_to_relate(); |
58 |
let vendors = cy.get_vendors_to_relate(); |
84 |
//Intercept vendors request |
59 |
//Intercept vendors request |
85 |
cy.intercept("GET", "/api/v1/acquisitions/vendors*", { |
60 |
cy.intercept("GET", "/api/v1/acquisitions/vendors*", { |
Lines 174-180
describe("License CRUD operations", () => {
Link Here
|
174 |
}); |
149 |
}); |
175 |
|
150 |
|
176 |
it("Edit license", () => { |
151 |
it("Edit license", () => { |
177 |
let license = get_license(); |
152 |
let license = cy.get_license(); |
178 |
let licenses = [license]; |
153 |
let licenses = [license]; |
179 |
let vendors = cy.get_vendors_to_relate(); |
154 |
let vendors = cy.get_vendors_to_relate(); |
180 |
|
155 |
|
Lines 256-262
describe("License CRUD operations", () => {
Link Here
|
256 |
}); |
231 |
}); |
257 |
|
232 |
|
258 |
it("Show license", () => { |
233 |
it("Show license", () => { |
259 |
let license = get_license(); |
234 |
let license = cy.get_license(); |
260 |
let licenses = [license]; |
235 |
let licenses = [license]; |
261 |
// Click the "name" link from the list |
236 |
// Click the "name" link from the list |
262 |
cy.intercept("GET", "/api/v1/erm/licenses*", { |
237 |
cy.intercept("GET", "/api/v1/erm/licenses*", { |
Lines 286-292
describe("License CRUD operations", () => {
Link Here
|
286 |
}); |
261 |
}); |
287 |
|
262 |
|
288 |
it("Delete license", () => { |
263 |
it("Delete license", () => { |
289 |
let license = get_license(); |
264 |
let license = cy.get_license(); |
290 |
let licenses = [license]; |
265 |
let licenses = [license]; |
291 |
|
266 |
|
292 |
// Click the 'Delete' button from the list |
267 |
// Click the 'Delete' button from the list |