View | Details | Raw Unified | Return to bug 38010
Collapse All | Expand All

(-)a/t/cypress/integration/Acquisitions/Vendors_spec.ts (-11 / +15 lines)
Lines 65-76 describe("Vendor CRUD operations", () => { Link Here
65
    it("should list vendors", () => {
65
    it("should list vendors", () => {
66
        cy.visit("/cgi-bin/koha/acqui/acqui-home.pl");
66
        cy.visit("/cgi-bin/koha/acqui/acqui-home.pl");
67
67
68
        cy.intercept("GET", "/api/v1/acquisitions/vendors*", []);
68
        cy.intercept("GET", "/api/v1/acquisitions/vendors\?*", []);
69
        cy.visit("/cgi-bin/koha/acquisition/vendors");
69
        cy.visit("/cgi-bin/koha/acquisition/vendors");
70
        cy.get("#vendors_list").contains("There are no vendors defined");
70
        cy.get("#vendors_list").contains("There are no vendors defined");
71
71
72
        const vendor = getVendor();
72
        const vendor = getVendor();
73
        cy.intercept("GET", "/api/v1/acquisitions/vendors*", {
73
        cy.intercept("GET", "/api/v1/acquisitions/vendors\?*", {
74
            statusCode: 200,
74
            statusCode: 200,
75
            body: [vendor],
75
            body: [vendor],
76
            headers: {
76
            headers: {
Lines 78-84 describe("Vendor CRUD operations", () => { Link Here
78
                "X-Total-Count": "1",
78
                "X-Total-Count": "1",
79
            },
79
            },
80
        });
80
        });
81
        cy.intercept("GET", "/api/v1/acquisitions/vendors/*", vendor);
82
        cy.visit("/cgi-bin/koha/acquisition/vendors");
81
        cy.visit("/cgi-bin/koha/acquisition/vendors");
83
        cy.get("#vendors_list").contains("Showing 1 to 1 of 1 entries");
82
        cy.get("#vendors_list").contains("Showing 1 to 1 of 1 entries");
84
    });
83
    });
Lines 86-92 describe("Vendor CRUD operations", () => { Link Here
86
    it("should add a vendor", () => {
85
    it("should add a vendor", () => {
87
        const vendor = getVendor();
86
        const vendor = getVendor();
88
87
89
        cy.intercept("GET", "/api/v1/acquisitions/vendors*", {
88
        cy.intercept("GET", "/api/v1/acquisitions/vendors\?*", {
90
            statusCode: 200,
89
            statusCode: 200,
91
            body: [],
90
            body: [],
92
        });
91
        });
Lines 181-189 describe("Vendor CRUD operations", () => { Link Here
181
        const vendor = getVendor();
180
        const vendor = getVendor();
182
181
183
        cy.visit("/cgi-bin/koha/acquisition/vendors");
182
        cy.visit("/cgi-bin/koha/acquisition/vendors");
184
        cy.intercept("GET", "/api/v1/acquisitions/vendors/*", vendor).as(
183
        cy.intercept(
185
            "get-vendor"
184
            "GET",
186
        );
185
            new RegExp("/api/v1/acquisitions/vendors/(?!config$).+"),
186
            vendor
187
        ).as("get-vendor");
187
188
188
        // Click the 'Edit' button from the list
189
        // Click the 'Edit' button from the list
189
        cy.get("#vendors_list table tbody tr:first").contains("Edit").click();
190
        cy.get("#vendors_list table tbody tr:first").contains("Edit").click();
Lines 210-216 describe("Vendor CRUD operations", () => { Link Here
210
        const vendor = getVendor();
211
        const vendor = getVendor();
211
212
212
        // Click the "name" link from the list
213
        // Click the "name" link from the list
213
        cy.intercept("GET", "/api/v1/acquisitions/vendors*", {
214
        cy.intercept("GET", "/api/v1/acquisitions/vendors\?*", {
214
            statusCode: 200,
215
            statusCode: 200,
215
            body: [vendor],
216
            body: [vendor],
216
            headers: {
217
            headers: {
Lines 235-241 describe("Vendor CRUD operations", () => { Link Here
235
236
236
        // Delete from list
237
        // Delete from list
237
        // Click the 'Delete' button from the list
238
        // Click the 'Delete' button from the list
238
        cy.intercept("GET", "/api/v1/acquisitions/vendors*", {
239
        cy.intercept("GET", "/api/v1/acquisitions/vendors\?*", {
239
            statusCode: 200,
240
            statusCode: 200,
240
            body: [vendor],
241
            body: [vendor],
241
            headers: {
242
            headers: {
Lines 243-249 describe("Vendor CRUD operations", () => { Link Here
243
                "X-Total-Count": "1",
244
                "X-Total-Count": "1",
244
            },
245
            },
245
        });
246
        });
246
        cy.intercept("GET", "/api/v1/acquisitions/vendors/*", vendor);
247
        cy.intercept(
248
            "GET",
249
            new RegExp("/api/v1/acquisitions/vendors/(?!config$).+"),
250
            vendor
251
        );
247
        cy.visit("/cgi-bin/koha/acquisition/vendors");
252
        cy.visit("/cgi-bin/koha/acquisition/vendors");
248
253
249
        cy.get("#vendors_list table tbody tr:first").contains("Delete").click();
254
        cy.get("#vendors_list table tbody tr:first").contains("Delete").click();
250
- 

Return to bug 38010