Bug 23612: (RM follow-up) Fix failing tests
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Fri, 4 Oct 2019 12:19:18 +0000 (13:19 +0100)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 7 Oct 2019 09:59:50 +0000 (10:59 +0100)
Trailing comma's were causing hidden javascript errors during selenium
tests.

Error was identified by adding a $s->capture($driver) line to the
relevant selenium test and using the following JS snippet to dump errors
to the screen.

   (function () {
       var ul = null;
       function createErrorList() {
           ul = document.createElement('ul');
           ul.setAttribute('id', 'js_error_list');
           //ul.style.display = 'none';
           document.body.appendChild(ul);
       }
       window.onerror = function(msg){
           if (ul === null)
               createErrorList();
           var li = document.createElement("li");
           li.appendChild(document.createTextNode(msg));
           ul.appendChild(li);
       };
   })();

Which clearly showed the following error.

    ReferenceError: KohaTable is not defined

Removing the trailing comma's introduced in this bug resolved the issue.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc

index a5c5e0c..f02ad89 100644 (file)
@@ -69,7 +69,7 @@ function KohaTable(id_selector, dt_parameters, columns_settings, add_filters) {
                 dt.search( "" ).draw("page");
                 node.addClass("disabled");
             }
-        },
+        }
     ];
 
     if( included_ids.length > 0 ){
@@ -83,8 +83,8 @@ function KohaTable(id_selector, dt_parameters, columns_settings, add_filters) {
                 text: '<i class="fa fa-lg fa-gear"></i> <span class="dt-button-text">' + _("Columns") + '</span>',
                 exportOptions: {
                     columns: exportColumns
-                },
-            },
+                }
+            }
         );
     }