You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by hn...@apache.org on 2019/07/26 09:15:21 UTC

[myfaces-tobago] branch master updated (3dd3ca2 -> 284819f)

This is an automated email from the ASF dual-hosted git repository.

hnoeth pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git.


    from 3dd3ca2  TOBAGO-1633: TS refactoring: fix integration tests
     new ba786e7  TOBAGO-1633: TS refactoring: fix integration tests
     new 284819f  TOBAGO-1633: TS refactoring: fix tc:date

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../src/main/npm/ts/tobago-calendar.ts             | 23 ++++++++++++++--------
 .../resources/tobago/test/tobago-test-tool.js      | 13 ------------
 2 files changed, 15 insertions(+), 21 deletions(-)


[myfaces-tobago] 02/02: TOBAGO-1633: TS refactoring: fix tc:date

Posted by hn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hnoeth pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git

commit 284819f6ff5aa09b60caa22bb4256cd4a94868aa
Author: Henning Noeth <hn...@apache.org>
AuthorDate: Fri Jul 26 11:15:00 2019 +0200

    TOBAGO-1633: TS refactoring: fix tc:date
    
    * fix null pointer exception
---
 .../src/main/npm/ts/tobago-calendar.ts             | 23 ++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-calendar.ts b/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-calendar.ts
index bb249ce..5fb4942 100644
--- a/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-calendar.ts
+++ b/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-calendar.ts
@@ -201,14 +201,21 @@ class DateTime {
 
       // fix for bootstrap-datetimepicker v4.17.45
       $dateParent.on('dp.show', function () {
-        document.querySelector(".bootstrap-datetimepicker-widget .collapse.in").classList.add("show");
-        document.querySelector(".bootstrap-datetimepicker-widget .picker-switch a").addEventListener(
-            "click", function () {
-              // the click is executed before togglePicker() function
-              let datetimepicker: HTMLDivElement = document.querySelector(".bootstrap-datetimepicker-widget");
-              datetimepicker.querySelector(".collapse.in").classList.remove("in");
-              datetimepicker.querySelector(".collapse.show").classList.add("in");
-            });
+        const collapseIn = document.querySelector(".bootstrap-datetimepicker-widget .collapse.in");
+        const pickerSwitch = document.querySelector(".bootstrap-datetimepicker-widget .picker-switch a");
+
+        if (collapseIn !== null) {
+          collapseIn.classList.add("show");
+        }
+        if (pickerSwitch !== null) {
+          pickerSwitch.addEventListener(
+              "click", function () {
+                // the click is executed before togglePicker() function
+                let datetimepicker: HTMLDivElement = document.querySelector(".bootstrap-datetimepicker-widget");
+                datetimepicker.querySelector(".collapse.in").classList.remove("in");
+                datetimepicker.querySelector(".collapse.show").classList.add("in");
+              });
+        }
       });
     }
   }


[myfaces-tobago] 01/02: TOBAGO-1633: TS refactoring: fix integration tests

Posted by hn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hnoeth pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git

commit ba786e75abf7871d3442fe8fdadc1125abda650d
Author: Henning Noeth <hn...@apache.org>
AuthorDate: Fri Jul 26 11:14:23 2019 +0200

    TOBAGO-1633: TS refactoring: fix integration tests
    
    * remove debug stuff
---
 .../META-INF/resources/tobago/test/tobago-test-tool.js      | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/tobago-tool/tobago-tool-test/src/main/resources/META-INF/resources/tobago/test/tobago-test-tool.js b/tobago-tool/tobago-tool-test/src/main/resources/META-INF/resources/tobago/test/tobago-test-tool.js
index 51c8055..88f0f15 100644
--- a/tobago-tool/tobago-tool-test/src/main/resources/META-INF/resources/tobago/test/tobago-test-tool.js
+++ b/tobago-tool/tobago-tool-test/src/main/resources/META-INF/resources/tobago/test/tobago-test-tool.js
@@ -136,15 +136,12 @@ TobagoTestTool.prototype = {
       function newXHR() {
         let realXHR = new oldXHR();
         realXHR.addEventListener("readystatechange", function () {
-          console.log("### ajax readyState: " + realXHR.readyState);
-
           if (realXHR.readyState !== XMLHttpRequest.UNSENT && realXHR.readyState !== XMLHttpRequest.DONE) {
             ajaxRequestDetected = true;
           } else if (ajaxRequestDetected && realXHR.readyState === XMLHttpRequest.DONE) {
             ajaxRequestDone = true;
             waitForResponse = false;
           }
-
         }, false);
         return realXHR;
       }
@@ -171,10 +168,7 @@ TobagoTestTool.prototype = {
     function cycle() {
       if (currentStep >= steps.length) {
         // we are done here
-        console.log("### done");
       } else if (Date.now() >= testStepTimeout) {
-        // timeout for this teststep: go to next step; if current step is an assert call done()
-        console.log("### timeout");
         assert.ok(false, "Timeout!");
         if (steps[currentStep].stepType === TobagoTestTool.stepType.ASSERTS) {
           done();
@@ -183,10 +177,8 @@ TobagoTestTool.prototype = {
         cycle();
       } else if (waitForResponse) {
         // we need to wait more
-        console.log("### waitForResponse=false");
         setTimeout(cycle, cycleTiming);
       } else if (steps[currentStep].type === TobagoTestTool.stepType.ACTION) {
-        console.log("### ACTION - step: " + currentStep);
         if (currentStep + 1 < steps.length && steps[currentStep + 1].type === TobagoTestTool.stepType.WAIT_RESPONSE) {
           // register listener for ajax before action is executed, otherwise the ajax listener is registered too late
           registerAjaxReadyStateListener();
@@ -200,7 +192,6 @@ TobagoTestTool.prototype = {
           setTimeout(cycle, cycleTiming);
         }
       } else if (steps[currentStep].type === TobagoTestTool.stepType.WAIT_RESPONSE) {
-        console.log("### WAIT_RESPONSE - step: " + currentStep);
         waitForResponse = true;
         ajaxRequestDetected = false;
         ajaxRequestDone = false;
@@ -213,21 +204,17 @@ TobagoTestTool.prototype = {
         resetTestStepTimeout();
         setTimeout(cycle, cycleTiming);
       } else if (steps[currentStep].type === TobagoTestTool.stepType.WAIT_MS) {
-        console.log("### WAIT_MS - step: " + currentStep);
         const ms = steps[currentStep].ms;
 
         currentStep++;
         resetTestStepTimeout(ms);
         setTimeout(cycle, ms);
       } else if (steps[currentStep].type === TobagoTestTool.stepType.ASSERTS) {
-        console.log("### ASSERTS - step: " + currentStep);
         steps[currentStep].func();
         currentStep++;
         done();
         resetTestStepTimeout();
         setTimeout(cycle, cycleTiming);
-      } else {
-        console.log("### this should not happen");
       }
     }