From 17cf580f19c772c5b3facba40e3f8db5dd0c5423 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 27 Oct 2023 15:36:06 +0000 Subject: [PATCH] Bug 34587: (QA follow-up) Tidy Signed-off-by: Nick Clemens Signed-off-by: Tomas Cohen Arazi --- Koha/ERM/EUsage/CounterFile.pm | 14 +- Koha/ERM/EUsage/SushiCounter.pm | 14 +- Koha/ERM/EUsage/UsageDataProvider.pm | 12 +- Koha/REST/V1/ERM/EUsage/CounterFiles.pm | 2 +- Koha/REST/V1/ERM/EUsage/CounterLogs.pm | 2 +- Koha/REST/V1/ERM/EUsage/CounterRegistry.pm | 4 +- .../background_jobs/erm_sushi_harvester.inc | 1 + .../intranet-tmpl/prog/js/vue/modules/erm.ts | 6 +- .../intranet-tmpl/prog/js/vue/routes/erm.js | 48 ++-- misc/cronjobs/erm_run_harvester.pl | 2 +- .../integration/ERM/UsageReports_spec.ts | 244 +++++++++--------- .../Koha/BackgroundJobs/ErmSushiHarvester.t | 2 +- t/db_dependent/Koha/ERM/EUsage/CounterFile.t | 2 +- t/db_dependent/Koha/ERM/EUsage/SushiCounter.t | 6 +- t/db_dependent/api/v1/erm_custom_reports.t | 2 +- 15 files changed, 187 insertions(+), 174 deletions(-) diff --git a/Koha/ERM/EUsage/CounterFile.pm b/Koha/ERM/EUsage/CounterFile.pm index 49bf4e9853..0836455251 100644 --- a/Koha/ERM/EUsage/CounterFile.pm +++ b/Koha/ERM/EUsage/CounterFile.pm @@ -488,31 +488,31 @@ sub _is_same_usage_object { return unless $previous_object; - if ( $previous_object->print_issn && $row->{Print_ISSN} ){ + if ( $previous_object->print_issn && $row->{Print_ISSN} ) { return unless $previous_object->print_issn eq $row->{Print_ISSN}; } - if ( $previous_object->online_issn && $row->{Online_ISSN} ){ + if ( $previous_object->online_issn && $row->{Online_ISSN} ) { return unless $previous_object->online_issn eq $row->{Online_ISSN}; } - if ( $previous_object->proprietary_id && $row->{Proprietary_ID} ){ + if ( $previous_object->proprietary_id && $row->{Proprietary_ID} ) { return unless $previous_object->proprietary_id eq $row->{Proprietary_ID}; } - if ( $previous_object->publisher && $row->{Publisher} ){ + if ( $previous_object->publisher && $row->{Publisher} ) { return unless $previous_object->publisher eq $row->{Publisher}; } - if ( $previous_object->platform && $row->{Platform} ){ + if ( $previous_object->platform && $row->{Platform} ) { return unless $previous_object->platform eq $row->{Platform}; } - if ( $previous_object->title_doi && $row->{DOI} ){ + if ( $previous_object->title_doi && $row->{DOI} ) { return unless $previous_object->title_doi eq $row->{DOI}; } - if ( $previous_object->title && $row->{Title} ){ + if ( $previous_object->title && $row->{Title} ) { return unless $previous_object->title eq $row->{Title}; } diff --git a/Koha/ERM/EUsage/SushiCounter.pm b/Koha/ERM/EUsage/SushiCounter.pm index ffd3bdf9a2..d128b868b7 100644 --- a/Koha/ERM/EUsage/SushiCounter.pm +++ b/Koha/ERM/EUsage/SushiCounter.pm @@ -110,10 +110,10 @@ sub _COUNTER_report_header { my $end_date = $self->_get_SUSHI_Name_Value( $header->{Report_Filters}, "End_Date" ); return ( - [ Report_Name => $header->{Report_Name} || "" ], - [ Report_ID => $header->{Report_ID} || "" ], - [ Release => $header->{Release} || "" ], - [ Institution_Name => $header->{Institution_Name} || "" ], + [ Report_Name => $header->{Report_Name} || "" ], + [ Report_ID => $header->{Report_ID} || "" ], + [ Release => $header->{Release} || "" ], + [ Institution_Name => $header->{Institution_Name} || "" ], [ Institution_ID => join( "; ", map( $_->{Type} . ":" . $_->{Value}, @{ $header->{Institution_ID} } ) ) || "" ], [ Metric_Types => join( "; ", split( /\|/, $metric_types_string[0] ) ) || "" ], [ Report_Filters => join( "; ", map( $_->{Name} . ":" . $_->{Value}, @{ $header->{Report_Filters} } ) ) || "" ], @@ -127,7 +127,7 @@ sub _COUNTER_report_header { || "" ], [ Reporting_Period => "Begin_Date=" . $begin_date . "; End_Date=" . $end_date ], - [ Created => $header->{Created} || "" ], + [ Created => $header->{Created} || "" ], [ Created_By => $header->{Created_By} || "" ], [""] #empty 13th line (COUNTER 5) ); @@ -269,7 +269,7 @@ sub _COUNTER_platform_report_row { return ( [ $platform_row->{Platform} || "", $metric_type, - $total_usage, @{$monthly_usages} + $total_usage, @{$monthly_usages} ] ); } @@ -715,7 +715,7 @@ sub get_report_type_specific_fields { "TR_J3" => ['Access_Type'], "TR_J4" => ['YOP'], "IR_A1" => [ - 'Authors', 'Publication_Date', 'Article_Version', 'Print_ISSN', 'Online_ISSN', 'Parent_Title', + 'Authors', 'Publication_Date', 'Article_Version', 'Print_ISSN', 'Online_ISSN', 'Parent_Title', 'Parent_Authors', 'Parent_Article_Version', 'Parent_DOI', 'Parent_Proprietary_ID', 'Parent_Print_ISSN', 'Parent_Online_ISSN', 'Parent_URI', 'Access_Type' ], diff --git a/Koha/ERM/EUsage/UsageDataProvider.pm b/Koha/ERM/EUsage/UsageDataProvider.pm index dfe615712a..28a6461935 100644 --- a/Koha/ERM/EUsage/UsageDataProvider.pm +++ b/Koha/ERM/EUsage/UsageDataProvider.pm @@ -275,7 +275,7 @@ sub test_connection { $url .= 'status'; $url .= '?customer_id=' . $self->customer_id; $url .= '&requestor_id=' . $self->requestor_id if $self->requestor_id; - $url .= '&api_key=' . $self->api_key if $self->api_key; + $url .= '&api_key=' . $self->api_key if $self->api_key; my $request = HTTP::Request->new( 'GET' => $url ); my $ua = LWP::UserAgent->new; @@ -342,7 +342,7 @@ Method to embed erm_usage_platforms to platforms for report formatting =cut sub erm_usage_platforms { - my ( $self ) = @_; + my ($self) = @_; my $usage_platform_rs = $self->_result->erm_usage_platforms; return Koha::ERM::EUsage::UsagePlatforms->_new_from_dbic($usage_platform_rs); } @@ -354,7 +354,7 @@ Method to embed erm_usage_items to items for report formatting =cut sub erm_usage_items { - my ( $self ) = @_; + my ($self) = @_; my $usage_item_rs = $self->_result->erm_usage_items; return Koha::ERM::EUsage::UsageItems->_new_from_dbic($usage_item_rs); } @@ -366,7 +366,7 @@ Method to embed erm_usage_databases to databases for report formatting =cut sub erm_usage_databases { - my ( $self ) = @_; + my ($self) = @_; my $usage_database_rs = $self->_result->erm_usage_databases; return Koha::ERM::EUsage::UsageDatabases->_new_from_dbic($usage_database_rs); } @@ -393,9 +393,9 @@ sub _build_url_query { $url .= lc $self->{report_type}; $url .= '?customer_id=' . $self->customer_id; $url .= '&requestor_id=' . $self->requestor_id if $self->requestor_id; - $url .= '&api_key=' . $self->api_key if $self->api_key; + $url .= '&api_key=' . $self->api_key if $self->api_key; $url .= '&begin_date=' . substr $self->{begin_date}, 0, 7 if $self->{begin_date}; - $url .= '&end_date=' . substr $self->{end_date}, 0, 7 if $self->{end_date}; + $url .= '&end_date=' . substr $self->{end_date}, 0, 7 if $self->{end_date}; return $url; } diff --git a/Koha/REST/V1/ERM/EUsage/CounterFiles.pm b/Koha/REST/V1/ERM/EUsage/CounterFiles.pm index 11bd79e2cc..ca65d6fabc 100644 --- a/Koha/REST/V1/ERM/EUsage/CounterFiles.pm +++ b/Koha/REST/V1/ERM/EUsage/CounterFiles.pm @@ -24,7 +24,7 @@ use Mojo::Base 'Mojolicious::Controller'; use Koha::ERM::EUsage::CounterFiles; use Scalar::Util qw( blessed ); -use Try::Tiny qw( catch try ); +use Try::Tiny qw( catch try ); =head1 API diff --git a/Koha/REST/V1/ERM/EUsage/CounterLogs.pm b/Koha/REST/V1/ERM/EUsage/CounterLogs.pm index 41e5348f22..b02ea00e0e 100644 --- a/Koha/REST/V1/ERM/EUsage/CounterLogs.pm +++ b/Koha/REST/V1/ERM/EUsage/CounterLogs.pm @@ -24,7 +24,7 @@ use Mojo::Base 'Mojolicious::Controller'; use Koha::ERM::EUsage::CounterLogs; use Scalar::Util qw( blessed ); -use Try::Tiny qw( catch try ); +use Try::Tiny qw( catch try ); =head1 API diff --git a/Koha/REST/V1/ERM/EUsage/CounterRegistry.pm b/Koha/REST/V1/ERM/EUsage/CounterRegistry.pm index d8ed673195..d29ebd29a8 100644 --- a/Koha/REST/V1/ERM/EUsage/CounterRegistry.pm +++ b/Koha/REST/V1/ERM/EUsage/CounterRegistry.pm @@ -23,8 +23,8 @@ use Mojo::Base 'Mojolicious::Controller'; use HTTP::Request; use LWP::UserAgent; use Scalar::Util qw( blessed ); -use JSON qw( from_json decode_json encode_json ); -use Try::Tiny qw( catch try ); +use JSON qw( from_json decode_json encode_json ); +use Try::Tiny qw( catch try ); use Koha::Exceptions; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/background_jobs/erm_sushi_harvester.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/background_jobs/erm_sushi_harvester.inc index d7098e4524..09f1f5c644 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/background_jobs/erm_sushi_harvester.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/background_jobs/erm_sushi_harvester.inc @@ -1,4 +1,5 @@ [% USE Koha %] +[% USE raw %] [% BLOCK report %] [% SET report = job.report %] diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/modules/erm.ts b/koha-tmpl/intranet-tmpl/prog/js/vue/modules/erm.ts index 84ff38b113..0a39c70d56 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/modules/erm.ts +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/modules/erm.ts @@ -24,7 +24,7 @@ import { useVendorStore } from "../stores/vendors"; import { useAVStore } from "../stores/authorised-values"; import { useERMStore } from "../stores/erm"; import { useNavigationStore } from "../stores/navigation"; -import { useReportsStore } from "../stores/usage-reports" +import { useReportsStore } from "../stores/usage-reports"; import i18n from "../i18n"; const pinia = createPinia(); @@ -56,8 +56,8 @@ app.provide("AVStore", AVStore); app.provide("navigationStore", navigationStore); const ERMStore = useERMStore(pinia); app.provide("ERMStore", ERMStore); -const reportsStore = useReportsStore(pinia) -app.provide("reportsStore", reportsStore) +const reportsStore = useReportsStore(pinia); +app.provide("reportsStore", reportsStore); app.mount("#erm"); diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/routes/erm.js b/koha-tmpl/intranet-tmpl/prog/js/vue/routes/erm.js index 0a55ba62e4..105744d8a2 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/routes/erm.js +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/routes/erm.js @@ -301,33 +301,43 @@ export const routes = [ { path: "", name: "UsageStatisticsDataProvidersList", - component: markRaw(UsageStatisticsDataProvidersList), + component: markRaw( + UsageStatisticsDataProvidersList + ), }, { path: ":usage_data_provider_id", name: "UsageStatisticsDataProvidersShow", - component: markRaw(UsageStatisticsDataProvidersShow), - title: $__("Show provider") + component: markRaw( + UsageStatisticsDataProvidersShow + ), + title: $__("Show provider"), }, { path: "add", name: "UsageStatisticsDataProvidersFormAdd", - component: markRaw(UsageStatisticsDataProvidersFormAdd), - title: $__("Add data provider") + component: markRaw( + UsageStatisticsDataProvidersFormAdd + ), + title: $__("Add data provider"), }, { path: "edit/:usage_data_provider_id", name: "UsageStatisticsDataProvidersFormAddEdit", - component: markRaw(UsageStatisticsDataProvidersFormAdd), - title: $__("Edit data provider") + component: markRaw( + UsageStatisticsDataProvidersFormAdd + ), + title: $__("Edit data provider"), }, { path: "summary", name: "UsageStatisticsDataProvidersSummary", - component: markRaw(UsageStatisticsDataProvidersSummary), - title: $__("Data providers summary") + component: markRaw( + UsageStatisticsDataProvidersSummary + ), + title: $__("Data providers summary"), }, - ] + ], }, { path: "reports", @@ -343,13 +353,15 @@ export const routes = [ { path: "viewer", name: "UsageStatisticsReportsViewer", - component: markRaw(UsageStatisticsReportsViewer), - title: $__("View report") - } - ] - } - ] - } + component: markRaw( + UsageStatisticsReportsViewer + ), + title: $__("View report"), + }, + ], + }, + ], + }, ], }, -]; \ No newline at end of file +]; diff --git a/misc/cronjobs/erm_run_harvester.pl b/misc/cronjobs/erm_run_harvester.pl index 0d0f9283a9..fa8f0b3828 100755 --- a/misc/cronjobs/erm_run_harvester.pl +++ b/misc/cronjobs/erm_run_harvester.pl @@ -18,7 +18,7 @@ # along with Koha; if not, see . use Modern::Perl; -use Getopt::Long qw( GetOptions ); +use Getopt::Long qw( GetOptions ); use Koha::DateUtils qw( dt_from_string ); use POSIX; diff --git a/t/cypress/integration/ERM/UsageReports_spec.ts b/t/cypress/integration/ERM/UsageReports_spec.ts index 3c4e05eb80..4b24dac422 100644 --- a/t/cypress/integration/ERM/UsageReports_spec.ts +++ b/t/cypress/integration/ERM/UsageReports_spec.ts @@ -1,24 +1,24 @@ -import { mount } from "@cypress/vue" +import { mount } from "@cypress/vue"; describe("Reports home tabs", () => { beforeEach(() => { - cy.login() - cy.title().should("eq", "Koha staff interface") + cy.login(); + cy.title().should("eq", "Koha staff interface"); cy.intercept( "GET", "/cgi-bin/koha/svc/config/systempreferences/?pref=ERMModule", '{"value":"1"}' - ) + ); cy.intercept( "GET", "/cgi-bin/koha/svc/config/systempreferences/?pref=ERMProviders", '{"value":"local"}' - ) + ); - const dataProvider = cy.get_usage_data_provider() - const dataProviders = [dataProvider] - const defaultReport = cy.get_default_report() - const defaulReports = [defaultReport] + const dataProvider = cy.get_usage_data_provider(); + const dataProviders = [dataProvider]; + const defaultReport = cy.get_default_report(); + const defaulReports = [defaultReport]; cy.intercept("GET", "/api/v1/erm/usage_data_providers*", { statusCode: 200, @@ -27,7 +27,7 @@ describe("Reports home tabs", () => { "X-Base-Total-Count": "1", "X-Total-Count": "1", }, - }) + }); cy.intercept("GET", "/api/v1/erm/default_usage_reports*", { statusCode: 200, body: defaulReports, @@ -35,43 +35,47 @@ describe("Reports home tabs", () => { "X-Base-Total-Count": "1", "X-Total-Count": "1", }, - }) + }); - cy.visit("/cgi-bin/koha/erm/eusage/reports") - }) + cy.visit("/cgi-bin/koha/erm/eusage/reports"); + }); it("Should display the saved reports page", () => { - cy.get("#report_builder .default-report h2") - .should('have.text', "Select saved report") - }) + cy.get("#report_builder .default-report h2").should( + "have.text", + "Select saved report" + ); + }); it("Should display the custom report builder", () => { - cy.get("#usage_data_providerstabs").contains("Create report").click() + cy.get("#usage_data_providerstabs").contains("Create report").click(); - cy.get("#report-builder h2") - .should('have.text', "Build a custom report") - }) -}) + cy.get("#report-builder h2").should( + "have.text", + "Build a custom report" + ); + }); +}); describe("Saved reports", () => { beforeEach(() => { - cy.login() - cy.title().should("eq", "Koha staff interface") + cy.login(); + cy.title().should("eq", "Koha staff interface"); cy.intercept( "GET", "/cgi-bin/koha/svc/config/systempreferences/?pref=ERMModule", '{"value":"1"}' - ) + ); cy.intercept( "GET", "/cgi-bin/koha/svc/config/systempreferences/?pref=ERMProviders", '{"value":"local"}' - ) + ); - const dataProvider = cy.get_usage_data_provider() - const dataProviders = [dataProvider] - const defaultReport = cy.get_default_report() - const defaulReports = [defaultReport] + const dataProvider = cy.get_usage_data_provider(); + const dataProviders = [dataProvider]; + const defaultReport = cy.get_default_report(); + const defaulReports = [defaultReport]; cy.intercept("GET", "/api/v1/erm/usage_data_providers*", { statusCode: 200, @@ -80,7 +84,7 @@ describe("Saved reports", () => { "X-Base-Total-Count": "1", "X-Total-Count": "1", }, - }) + }); cy.intercept("GET", "/api/v1/erm/default_usage_reports*", { statusCode: 200, body: defaulReports, @@ -88,57 +92,58 @@ describe("Saved reports", () => { "X-Base-Total-Count": "1", "X-Total-Count": "1", }, - }) + }); - cy.visit("/cgi-bin/koha/erm/eusage/reports") - }) + cy.visit("/cgi-bin/koha/erm/eusage/reports"); + }); it("Should correctly populate the dropdown menu", () => { - const defaultReport = cy.get_default_report() + const defaultReport = cy.get_default_report(); - cy.get("#default_usage_reports .vs__open-indicator").click() + cy.get("#default_usage_reports .vs__open-indicator").click(); cy.get("#default_usage_reports .vs__dropdown-menu li:first").should( - "have.text", defaultReport.report_name - ) - }) + "have.text", + defaultReport.report_name + ); + }); it("Should redirect to the reports viewer with the correct url params", () => { - const defaultReport = cy.get_default_report() + const defaultReport = cy.get_default_report(); cy.get("#default_usage_reports .vs__search").type( - defaultReport.report_name + "{enter}", + defaultReport.report_name + "{enter}", { force: true } - ) - - cy.get("#report_builder .default-report .action input").click() + ); + + cy.get("#report_builder .default-report .action input").click(); cy.url({ decode: true }).then(url => { - const urlParams = url.split('viewer?')[1].split('data=')[1] - const reportParams = defaultReport.report_url_params + const urlParams = url.split("viewer?")[1].split("data=")[1]; + const reportParams = defaultReport.report_url_params; - expect(urlParams).to.eq(reportParams) - }) - }) -}) + expect(urlParams).to.eq(reportParams); + }); + }); +}); describe("Custom reports", () => { beforeEach(() => { - cy.login() - cy.title().should("eq", "Koha staff interface") + cy.login(); + cy.title().should("eq", "Koha staff interface"); cy.intercept( "GET", "/cgi-bin/koha/svc/config/systempreferences/?pref=ERMModule", '{"value":"1"}' - ) + ); cy.intercept( "GET", "/cgi-bin/koha/svc/config/systempreferences/?pref=ERMProviders", '{"value":"local"}' - ) + ); - const dataProviders = cy.get_multiple_providers() - const defaultReport = cy.get_default_report() - const defaultReports = [defaultReport] + const dataProviders = cy.get_multiple_providers(); + const defaultReport = cy.get_default_report(); + const defaultReports = [defaultReport]; cy.intercept("GET", "/api/v1/erm/usage_data_providers*", { statusCode: 200, @@ -147,7 +152,7 @@ describe("Custom reports", () => { "X-Base-Total-Count": "1", "X-Total-Count": "1", }, - }) + }); cy.intercept("GET", "/api/v1/erm/default_usage_reports*", { statusCode: 200, body: defaultReports, @@ -155,84 +160,79 @@ describe("Custom reports", () => { "X-Base-Total-Count": "1", "X-Total-Count": "1", }, - }) + }); - cy.visit("/cgi-bin/koha/erm/eusage/reports") - cy.get("#usage_data_providerstabs").contains("Create report").click() - }) + cy.visit("/cgi-bin/koha/erm/eusage/reports"); + cy.get("#usage_data_providerstabs").contains("Create report").click(); + }); it("Should limit report types based on the provider(s) selected", () => { - const dataProviders = cy.get_multiple_providers() - cy.get('#report_type').find('.vs__actions').click() - cy.get('#report_type').find('li').as('options') - cy.get('@options').should('have.length', 16) + const dataProviders = cy.get_multiple_providers(); + cy.get("#report_type").find(".vs__actions").click(); + cy.get("#report_type").find("li").as("options"); + cy.get("@options").should("have.length", 16); cy.get("#usage_data_provider .vs__search").type( dataProviders[0].name + "{enter}", { force: true } - ) - cy.get('#report_type').find('.vs__actions').click() - cy.get('#report_type').find('li').as('options') - cy.get('@options').should('have.length', 1) - + ); + cy.get("#report_type").find(".vs__actions").click(); + cy.get("#report_type").find("li").as("options"); + cy.get("@options").should("have.length", 1); + cy.get("#usage_data_provider .vs__search").type( dataProviders[1].name + "{enter}", { force: true } - ) - cy.get('#report_type').find('.vs__actions').click() - cy.get('#report_type').find('li').as('options') - cy.get('@options').should('have.length', 3) - }) + ); + cy.get("#report_type").find(".vs__actions").click(); + cy.get("#report_type").find("li").as("options"); + cy.get("@options").should("have.length", 3); + }); it("Should limit data providers based on the report type(s) selected", () => { - cy.get('#usage_data_provider').find('.vs__actions').click() - cy.get('#usage_data_provider').find('li').as('options') - cy.get('@options').should('have.length', 2) - - cy.get("#report_type .vs__search").type( - "TR_J2" + "{enter}", - { force: true } - ) - cy.get('#usage_data_provider').find('.vs__actions').click() - cy.get('#usage_data_provider').find('li').as('options') - cy.get('@options').should('have.length', 1) - - cy.get("#report_type .vs__search").type( - "TR_J1" + "{enter}", - { force: true } - ) - cy.get('#usage_data_provider').find('.vs__actions').click() - cy.get('#usage_data_provider').find('li').as('options') - cy.get('@options').should('have.length', 2) - }) + cy.get("#usage_data_provider").find(".vs__actions").click(); + cy.get("#usage_data_provider").find("li").as("options"); + cy.get("@options").should("have.length", 2); + + cy.get("#report_type .vs__search").type("TR_J2" + "{enter}", { + force: true, + }); + cy.get("#usage_data_provider").find(".vs__actions").click(); + cy.get("#usage_data_provider").find("li").as("options"); + cy.get("@options").should("have.length", 1); + + cy.get("#report_type .vs__search").type("TR_J1" + "{enter}", { + force: true, + }); + cy.get("#usage_data_provider").find(".vs__actions").click(); + cy.get("#usage_data_provider").find("li").as("options"); + cy.get("@options").should("have.length", 2); + }); it("Should limit metric types based on the report type(s) selected", () => { - cy.get("#metric_type .vs__search").should('be.disabled') - - cy.get("#report_type .vs__search").type( - "TR_J1" + "{enter}", - { force: true } - ) - cy.get('#metric_type').find('.vs__actions').click() - cy.get('#metric_type').find('li').as('options') - cy.get('@options').should('have.length', 2) - - cy.get("#report_type .vs__search").type( - "PR" + "{enter}", - { force: true } - ) - cy.get('#metric_type').find('.vs__actions').click() - cy.get('#metric_type').find('li').as('options') - cy.get('@options').should('have.length', 7) - }) + cy.get("#metric_type .vs__search").should("be.disabled"); + + cy.get("#report_type .vs__search").type("TR_J1" + "{enter}", { + force: true, + }); + cy.get("#metric_type").find(".vs__actions").click(); + cy.get("#metric_type").find("li").as("options"); + cy.get("@options").should("have.length", 2); + + cy.get("#report_type .vs__search").type("PR" + "{enter}", { + force: true, + }); + cy.get("#metric_type").find(".vs__actions").click(); + cy.get("#metric_type").find("li").as("options"); + cy.get("@options").should("have.length", 7); + }); it("Should disable the month selectors when a yearly report is selected", () => { - cy.get("#interval .vs__search").type( - "By year" + "{enter}", - { force: true } - ) - - cy.get("#start-month .vs__search").should('be.disabled') - cy.get("#end_month .vs__search").should('be.disabled') - }) -}) \ No newline at end of file + cy.get("#interval .vs__search").type("By year" + "{enter}", { + force: true, + }); + + cy.get("#start-month .vs__search").should("be.disabled"); + cy.get("#end_month .vs__search").should("be.disabled"); + }); +}); diff --git a/t/db_dependent/Koha/BackgroundJobs/ErmSushiHarvester.t b/t/db_dependent/Koha/BackgroundJobs/ErmSushiHarvester.t index dde89a0b16..ace123e7d4 100755 --- a/t/db_dependent/Koha/BackgroundJobs/ErmSushiHarvester.t +++ b/t/db_dependent/Koha/BackgroundJobs/ErmSushiHarvester.t @@ -23,7 +23,7 @@ use Koha::Database; use Koha::BackgroundJobs; use Koha::BackgroundJob::ErmSushiHarvester; -use JSON qw( decode_json ); +use JSON qw( decode_json ); use File::Basename qw( dirname ); use File::Slurp; diff --git a/t/db_dependent/Koha/ERM/EUsage/CounterFile.t b/t/db_dependent/Koha/ERM/EUsage/CounterFile.t index d088472d5b..65c363fa52 100755 --- a/t/db_dependent/Koha/ERM/EUsage/CounterFile.t +++ b/t/db_dependent/Koha/ERM/EUsage/CounterFile.t @@ -22,7 +22,7 @@ use Test::More tests => 2; use Koha::Database; use Koha::ERM::EUsage::CounterFile; -use JSON qw( decode_json ); +use JSON qw( decode_json ); use File::Basename qw( dirname ); use File::Slurp; diff --git a/t/db_dependent/Koha/ERM/EUsage/SushiCounter.t b/t/db_dependent/Koha/ERM/EUsage/SushiCounter.t index d91ee1621f..5917f51664 100755 --- a/t/db_dependent/Koha/ERM/EUsage/SushiCounter.t +++ b/t/db_dependent/Koha/ERM/EUsage/SushiCounter.t @@ -21,7 +21,7 @@ use Test::More tests => 15; use Koha::ERM::EUsage::SushiCounter; use Koha::Database; -use JSON qw( decode_json ); +use JSON qw( decode_json ); use File::Basename qw( dirname ); use File::Slurp; @@ -803,8 +803,8 @@ subtest 'TR_B3 _COUNTER_report_body' => sub { is( $report_body[8][10], '2002', '1st title, 2nd yop has 6 metric types' ); # The data is in the correct column - is( $report_body[2][0], 'Insect Cell Culture: Fundamental and Applied Aspects', '1st column is title' ); - is( $report_body[2][1], 'Test Publisher', '2nd column is publisher' ); + is( $report_body[2][0], 'Insect Cell Culture: Fundamental and Applied Aspects', '1st column is title' ); + is( $report_body[2][1], 'Test Publisher', '2nd column is publisher' ); is( $report_body[2][2], '', '3rd column heading is publisher ID' ); is( $report_body[2][3], 'Test Platform', '4th column is platform' ); is( $report_body[2][4], '10.1007/0-306-46850-6', '5th column is DOI' ); diff --git a/t/db_dependent/api/v1/erm_custom_reports.t b/t/db_dependent/api/v1/erm_custom_reports.t index b0f2dbb12e..d5658cb35a 100755 --- a/t/db_dependent/api/v1/erm_custom_reports.t +++ b/t/db_dependent/api/v1/erm_custom_reports.t @@ -30,7 +30,7 @@ use Koha::ERM::EUsage::SushiCounter; use Koha::ERM::EUsage::MonthlyUsages; use Koha::ERM::EUsage::YearlyUsages; -use JSON qw( decode_json ); +use JSON qw( decode_json ); use File::Basename qw( dirname ); use File::Slurp; -- 2.39.5