Bugzilla – Attachment 189159 Details for
Bug 38446
Permission error for additional fields
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38446: Add a unit test for the additional fields wrapper
Bug-38446-Add-a-unit-test-for-the-additional-field.patch (text/plain), 2.00 KB, created by
Matt Blenkinsop
on 2025-11-06 11:40:26 UTC
(
hide
)
Description:
Bug 38446: Add a unit test for the additional fields wrapper
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2025-11-06 11:40:26 UTC
Size:
2.00 KB
patch
obsolete
>From 20ceca67ca3518efcb39c35f39a8b7934c3d889e Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> >Date: Thu, 6 Nov 2025 11:38:45 +0000 >Subject: [PATCH] Bug 38446: Add a unit test for the additional fields wrapper > >Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> >--- > .../api/additionalFieldsAPIClient.ts | 27 +++++++++++++++++++ > 1 file changed, 27 insertions(+) > create mode 100644 t/cypress/component/api/additionalFieldsAPIClient.ts > >diff --git a/t/cypress/component/api/additionalFieldsAPIClient.ts b/t/cypress/component/api/additionalFieldsAPIClient.ts >new file mode 100644 >index 00000000000..70f42400e60 >--- /dev/null >+++ b/t/cypress/component/api/additionalFieldsAPIClient.ts >@@ -0,0 +1,27 @@ >+import AdditionalFieldsAPIClient from "@fetch/additional-fields-api-client"; >+import HttpClient from "@fetch/http-client"; >+ >+describe("AdditionalFieldsAPIClientWrapper", () => { >+ it("Correctly loads the wrapper when called", () => { >+ const client = new AdditionalFieldsAPIClient(HttpClient); >+ expect(client).to.have.property("clients"); >+ }); >+ it("Can correctly pick a module based on a resource type", () => { >+ const client = new AdditionalFieldsAPIClient(HttpClient); >+ const getModuleName = client.getModuleName; >+ expect(getModuleName("agreement")).to.eq("erm"); >+ expect(getModuleName("license")).to.eq("erm"); >+ expect(getModuleName("package")).to.eq("erm"); >+ expect(getModuleName()).to.eq("admin"); >+ expect(getModuleName("dummyModule")).to.eq("admin"); >+ }); >+ it("Can correctly call the endpoint for that module", async () => { >+ const client = new AdditionalFieldsAPIClient(HttpClient); >+ >+ const ermResult = await client.additional_fields.getAll("agreement"); >+ expect(ermResult.url).to.include("v1/erm/extended"); >+ >+ const adminResult = await client.additional_fields.getAll(); >+ expect(adminResult.url).to.include("v1/extended"); >+ }); >+}); >-- >2.50.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 38446
:
174758
|
176471
|
183133
|
189010
|
189013
|
189158
| 189159