Bugzilla – Attachment 174884 Details for
Bug 38503
Add a Cypress task to generate objects based on its swagger def spec
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38503: Deal with types that can be "null"
Bug-38503-Deal-with-types-that-can-be-null.patch (text/plain), 1.30 KB, created by
Jonathan Druart
on 2024-11-21 14:16:22 UTC
(
hide
)
Description:
Bug 38503: Deal with types that can be "null"
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2024-11-21 14:16:22 UTC
Size:
1.30 KB
patch
obsolete
>From d950a82aa442a1fcb95d76c47b0a13cc37e206db Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 38503
:
174872
|
174873
|
174874
|
174875
|
174876
| 174884 |
174885
|
174921
|
174922