Bug 32807: Fix cypress tests
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 29 Mar 2023 07:38:50 +0000 (09:38 +0200)
committerTomas Cohen Arazi <tomascohen@theke.io>
Wed, 29 Mar 2023 10:28:49 +0000 (12:28 +0200)
Cypress tests were failing, not sure I understand why exactly as I don't
recreate the failure when using the interface. We could simplify the if
logic anyway.

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue
koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalPackagesList.vue
koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlesList.vue
koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/LicensesList.vue

index 51e63a9..b8d9f49 100644 (file)
@@ -1,6 +1,6 @@
 <template>
     <div v-if="!initialized">{{ $__("Loading") }}</div>
-    <div v-else-if="agreement_count" id="agreements_list">
+    <div v-else id="agreements_list">
         <Toolbar v-if="before_route_entered" />
         <fieldset v-if="agreement_count > 0" class="filters">
             <label for="expired_filter">{{ $__("Filter by expired") }}:</label>
@@ -35,7 +35,7 @@
         <div v-if="agreement_count > 0" class="page-section">
             <table :id="table_id"></table>
         </div>
-        <div v-else-if="initialized" class="dialog message">
+        <div v-else class="dialog message">
             {{ $__("There are no agreements defined") }}
         </div>
     </div>
@@ -75,7 +75,7 @@ export default {
     data: function () {
         return {
             fp_config: flatpickr_defaults,
-            agreement_count: null,
+            agreement_count: 0,
             initialized: false,
             filters: {
                 by_expired: this.$route.query.by_expired || false,
index 5196712..ba9a0c9 100644 (file)
@@ -1,7 +1,7 @@
 <template>
     <div>
         <div v-if="!initialized">{{ $__("Loading") }}</div>
-        <div v-else-if="package_count" id="packages_list">
+        <div v-else id="packages_list">
             <Toolbar />
             <div
                 v-if="package_count > 0"
@@ -10,7 +10,7 @@
             >
                 <table :id="table_id"></table>
             </div>
-            <div v-else-if="initialized" class="dialog message">
+            <div v-else class="dialog message">
                 {{ $__("There are no packages defined") }}
             </div>
         </div>
@@ -48,7 +48,7 @@ export default {
     },
     data: function () {
         return {
-            package_count: null,
+            package_count: 0,
             initialized: false,
             filters: {
                 package_name: this.$route.query.package_name || "",
index 598d54b..e81d8ca 100644 (file)
@@ -1,7 +1,7 @@
 <template>
     <div>
         <div v-if="!initialized">{{ $__("Loading") }}</div>
-        <div v-else-if="title_count" id="titles_list">
+        <div v-else id="titles_list">
             <Toolbar />
             <div
                 v-if="title_count > 0"
@@ -10,7 +10,7 @@
             >
                 <table :id="table_id"></table>
             </div>
-            <div v-else-if="initialized" class="dialog message">
+            <div v-else class="dialog message">
                 {{ $__("There are no titles defined") }}
             </div>
         </div>
@@ -46,7 +46,7 @@ export default {
     },
     data: function () {
         return {
-            title_count: null,
+            title_count: 0,
             initialized: false,
             filters: {
                 publication_title: this.$route.query.publication_title || "",
index 1ff7243..4ddf9fe 100644 (file)
@@ -1,11 +1,11 @@
 <template>
     <div v-if="!initialized">{{ $__("Loading") }}</div>
-    <div v-else-if="license_count" id="licenses_list">
+    <div v-else id="licenses_list">
         <Toolbar />
         <div v-if="license_count > 0" class="page-section">
             <table :id="table_id"></table>
         </div>
-        <div v-else-if="initialized" class="dialog message">
+        <div v-else class="dialog message">
             {{ $__("There are no licenses defined") }}
         </div>
     </div>
@@ -42,7 +42,7 @@ export default {
     },
     data: function () {
         return {
-            license_count: null,
+            license_count: 0,
             initialized: false,
         }
     },