Bugzilla – Attachment 194326 Details for
Bug 41178
SIP2 module does not notify that linked accounts are deleted when deleting an institution
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41178: Add cypress test
Bug-41178-Add-cypress-test.patch (text/plain), 3.09 KB, created by
Pedro Amorim
on 2026-03-02 11:00:19 UTC
(
hide
)
Description:
Bug 41178: Add cypress test
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2026-03-02 11:00:19 UTC
Size:
3.09 KB
patch
obsolete
>From 142ebe01cecb5a3f2bd61d81e2fb003bc60385d0 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@openfifth.co.uk> >Date: Mon, 2 Mar 2026 10:56:30 +0000 >Subject: [PATCH] Bug 41178: Add cypress test > >Run: >cypress run --spec t/cypress/integration/SIP2/Institutions.ts > >Test plan: >1) Create a SIP institution, visit: > http://localhost:8081/cgi-bin/koha/sip2/institutions/add >2) Create a SIP account linked to the institution from 1): > http://localhost:8081/cgi-bin/koha/sip2/accounts/add >3) Go back to institutions: > http://localhost:8081/cgi-bin/koha/sip2/institutions >4) Click 'delete'. Confirm the delete confirmation message contains: >'It has 1 associated accounts...' >5) Confirm that, notice the institution (and linked account) were >deleted as expected and alerted >6) Repeat the test plan for the 'view' page instead of 'list' page: >http://localhost:8081/cgi-bin/koha/sip2/institutions/<id_here> >7) Repeat the test plan but using an institution without any >linked accounts. Confirm the 'regular' delete message is shown, >which contains only the institution name in the modal body. >--- > t/cypress/integration/SIP2/Institutions.ts | 44 ++++++++++++++++++++++ > 1 file changed, 44 insertions(+) > >diff --git a/t/cypress/integration/SIP2/Institutions.ts b/t/cypress/integration/SIP2/Institutions.ts >index f1c4dd3fdc7..dddf8ec93a4 100644 >--- a/t/cypress/integration/SIP2/Institutions.ts >+++ b/t/cypress/integration/SIP2/Institutions.ts >@@ -282,4 +282,48 @@ describe("Institutions", () => { > //Make sure we return to list after deleting from show > cy.get("#institutions_list table tbody tr:first"); > }); >+ >+ it("Delete institution with accounts linked", () => { >+ let institution = cy.getSIP2Institution(); >+ let institutions = [institution]; >+ >+ // Delete from list >+ // Click the 'Delete' button from the list >+ cy.intercept("GET", "/api/v1/sip2/institutions*", { >+ statusCode: 200, >+ body: institutions, >+ headers: { >+ "X-Base-Total-Count": "1", >+ "X-Total-Count": "1", >+ }, >+ }); >+ cy.intercept("GET", "/api/v1/sip2/institutions/*", institution); >+ cy.visit("/cgi-bin/koha/sip2/institutions"); >+ >+ let linked_account_loginid = "my_login"; >+ cy.intercept("GET", "/api/v1/sip2/accounts**", [ >+ { login_id: linked_account_loginid }, >+ ]); >+ >+ cy.intercept("DELETE", "/api/v1/sip2/institutions/*", { >+ statusCode: 204, >+ body: null, >+ }); >+ >+ cy.get("#institutions_list table tbody tr:first") >+ .contains("Delete") >+ .click(); >+ cy.get(".confirmation.modal.show .modal-body").contains( >+ "It has 1 associated accounts" >+ ); >+ cy.contains(linked_account_loginid); >+ >+ cy.get(".alert-warning.confirmation h1").contains( >+ "remove this institution" >+ ); >+ cy.contains("Yes, delete").click(); >+ cy.get("main div[class='alert alert-info']") >+ .contains("Institution") >+ .contains("deleted"); >+ }); > }); >-- >2.39.5
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 41178
:
189034
|
189035
|
189036
|
194323
|
194324
|
194325
|
194326
|
194349
|
194350
|
194351
|
194352