From 9f89f83e1319a18e2adc2af961511be08050d7a8 Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Mon, 16 Sep 2024 15:29:32 +0000 Subject: [PATCH] Bug 37930: Update cypress tests Test plan: 1) Run the cypress tests for ERM and Preservation 2) All tests should still pass --- .../integration/Preservation/Settings.ts | 75 +++++++++--------- t/cypress/integration/Preservation/Trains.ts | 78 +++++++++++-------- 2 files changed, 83 insertions(+), 70 deletions(-) diff --git a/t/cypress/integration/Preservation/Settings.ts b/t/cypress/integration/Preservation/Settings.ts index 9ad10dd4b30..5ae14725676 100644 --- a/t/cypress/integration/Preservation/Settings.ts +++ b/t/cypress/integration/Preservation/Settings.ts @@ -42,42 +42,45 @@ describe("Processings", () => { '{"permissions":{"manage_sysprefs":"1"},"settings":{"enabled":"1","not_for_loan_default_train_in":"42","not_for_loan_waiting_list_in": "24"}}' ); - cy.intercept( - "GET", - "/api/v1/authorised_value_categories/NOT_LOAN/authorised_values", - [ - { - category_name: "NOT_LOAN", - description: "Ordered", - value: "-1", - }, - { - category_name: "NOT_LOAN", - description: "Not for loan", - value: "1", - }, - { - category_name: "NOT_LOAN", - description: "Staff collection", - value: "2", - }, - { - category_name: "NOT_LOAN", - description: "Added to bundle", - value: "3", - }, - { - category_name: "NOT_LOAN", - description: "In preservation", - value: "24", - }, - { - category_name: "NOT_LOAN", - description: "In preservation external", - value: "42", - }, - ] - ); + cy.intercept("GET", "/api/v1/authorised_value_categories?*", [ + { + authorised_values: [ + { + category_name: "NOT_LOAN", + description: "Ordered", + value: "-1", + }, + { + category_name: "NOT_LOAN", + description: "Not for loan", + value: "1", + }, + { + category_name: "NOT_LOAN", + description: "Staff collection", + value: "2", + }, + { + category_name: "NOT_LOAN", + description: "Added to bundle", + value: "3", + }, + { + category_name: "NOT_LOAN", + description: "In preservation", + value: "24", + }, + { + category_name: "NOT_LOAN", + description: "In preservation external", + value: "42", + }, + ], + category_name: "NOT_LOAN", + is_integer_only: false, + is_system: true, + }, + ]); }); it("Settings", () => { diff --git a/t/cypress/integration/Preservation/Trains.ts b/t/cypress/integration/Preservation/Trains.ts index 117614b189f..d6ffed9d75b 100644 --- a/t/cypress/integration/Preservation/Trains.ts +++ b/t/cypress/integration/Preservation/Trains.ts @@ -213,43 +213,53 @@ describe("Trains", () => { ); cy.intercept( - "GET", - "/api/v1/authorised_value_categories/NOT_LOAN/authorised_values", + { + method: "GET", + url: "/api/v1/authorised_value_categories?*", + times: 1, + }, [ { + authorised_values: [ + { + category_name: "NOT_LOAN", + description: "Ordered", + value: "-1", + }, + { + category_name: "NOT_LOAN", + description: "Not for loan", + value: "1", + }, + { + category_name: "NOT_LOAN", + description: "Staff collection", + value: "2", + }, + { + category_name: "NOT_LOAN", + description: "Added to bundle", + value: "3", + }, + { + category_name: "NOT_LOAN", + description: "In preservation", + value: "24", + }, + { + category_name: "NOT_LOAN", + description: "In preservation external", + value: "42", + }, + { + category_name: "NOT_LOAN", + description: "In preservation other", + value: "43", + }, + ], category_name: "NOT_LOAN", - description: "Ordered", - value: "-1", - }, - { - category_name: "NOT_LOAN", - description: "Not for loan", - value: "1", - }, - { - category_name: "NOT_LOAN", - description: "Staff collection", - value: "2", - }, - { - category_name: "NOT_LOAN", - description: "Added to bundle", - value: "3", - }, - { - category_name: "NOT_LOAN", - description: "In preservation", - value: "24", - }, - { - category_name: "NOT_LOAN", - description: "In preservation external", - value: "42", - }, - { - category_name: "NOT_LOAN", - description: "In preservation other", - value: "43", + is_integer_only: false, + is_system: true, }, ] ); -- 2.39.3 (Apple Git-146)