Bugzilla – Attachment 183196 Details for
Bug 40046
Remove wait and screenshot from Tools/ManageMarcImport_spec.ts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40046: Use xml and auto-select it
Bug-40046-Use-xml-and-auto-select-it.patch (text/plain), 3.09 KB, created by
Jonathan Druart
on 2025-06-12 11:37:18 UTC
(
hide
)
Description:
Bug 40046: Use xml and auto-select it
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-06-12 11:37:18 UTC
Size:
3.09 KB
patch
obsolete
>From f26302bfbe9392e0caad25fd3e5290c6622614b6 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 12 Jun 2025 13:35:42 +0200 >Subject: [PATCH] Bug 40046: Use xml and auto-select it > >Absolutely no idea why the previous code was not selecting MARCXML (MARC >was passed and so the import failed) > > cy.get('select[name="format"]') > .select("MARCXML", { force: true }) > .should("have.value", "MARCXML"); > >But I found a bug in the JS code: we are supposed to auto-detect .xml >file and pre-select MARCXML. So let's rely on that behaviour! > >sample.mrc is actually an xml file so it makes sense to rename it >--- > .../prog/en/modules/tools/stage-marc-import.tt | 2 +- > t/cypress/fixtures/{sample.mrc => sample.xml} | 0 > t/cypress/integration/Tools/ManageMarcImport_spec.ts | 8 +++----- > 3 files changed, 4 insertions(+), 6 deletions(-) > rename t/cypress/fixtures/{sample.mrc => sample.xml} (100%) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt >index d5ff4771b5f..e42fde81c6b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt >@@ -471,7 +471,7 @@ > $('#fileuploadbutton').show(); > $("#fileuploadcancel").hide(); > var filename=$('#fileToUpload').prop('files')[0].name; >- if( filename.match( new RegExp(/\.[^.]+xml$/) ) ) { >+ if( filename.match( new RegExp(/[^.]+\.xml$/) ) ) { > $('#format').val('MARCXML'); > } > $("#processfile").show(); >diff --git a/t/cypress/fixtures/sample.mrc b/t/cypress/fixtures/sample.xml >similarity index 100% >rename from t/cypress/fixtures/sample.mrc >rename to t/cypress/fixtures/sample.xml >diff --git a/t/cypress/integration/Tools/ManageMarcImport_spec.ts b/t/cypress/integration/Tools/ManageMarcImport_spec.ts >index f3483e6cfc5..e27f3cf9a1f 100644 >--- a/t/cypress/integration/Tools/ManageMarcImport_spec.ts >+++ b/t/cypress/integration/Tools/ManageMarcImport_spec.ts >@@ -27,8 +27,8 @@ describe("loads the manage MARC import page", () => { > it("upload a MARC record", () => { > cy.visit("/cgi-bin/koha/tools/stage-marc-import.pl"); > >- cy.fixture("sample.mrc", null).as("sample_mrc"); >- cy.get("input[type=file]").selectFile("@sample_mrc"); >+ cy.fixture("sample.xml", null).as("sample_xml"); >+ cy.get("input[type=file]").selectFile("@sample_xml"); > cy.get("#fileuploadbutton").click(); > > cy.get("#fileuploadstatus").contains("100%"); >@@ -51,9 +51,7 @@ describe("loads the manage MARC import page", () => { > "always_add" > ); > >- cy.get('select[name="format"]') >- .select("MARCXML", { force: true }) >- .should("have.value", "MARCXML"); >+ cy.get('select[name="format"]').should("have.value", "MARCXML"); > > //select some new options > cy.get("#matcher").select("3", { force: true }); >-- >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 40046
:
182903
|
182912
|
182921
|
182932
|
183195
| 183196