From d950a82aa442a1fcb95d76c47b0a13cc37e206db Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 21 Nov 2024 15:00:26 +0100 Subject: [PATCH] Bug 38503: Deal with types that can be "null" --- t/cypress/integration/t/mockData.ts | 1 + t/cypress/plugins/mockData.js | 3 +++ 2 files changed, 4 insertions(+) diff --git a/t/cypress/integration/t/mockData.ts b/t/cypress/integration/t/mockData.ts index cdc1c08ec53..5ca38a99998 100644 --- a/t/cypress/integration/t/mockData.ts +++ b/t/cypress/integration/t/mockData.ts @@ -12,6 +12,7 @@ describe("Generate Random Patron", () => { values: { surname: "test_surname" }, }).then(mockPatron => { expect(mockPatron.surname).to.equal("test_surname"); + expect(mockPatron.overdues_count).to.be.a("number"); }); }); }); diff --git a/t/cypress/plugins/mockData.js b/t/cypress/plugins/mockData.js index 02ec1a7aba6..855a55ba692 100644 --- a/t/cypress/plugins/mockData.js +++ b/t/cypress/plugins/mockData.js @@ -10,6 +10,9 @@ const objects = { }, }; const generateMockData = type => { + if (Array.isArray(type)) { + type = type.filter(t => t != '"null"')[0]; + } switch (type) { case "string": return faker.lorem.words(3); -- 2.34.1