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 2020/03/24 12:52:21 UTC

[myfaces-tobago] branch master updated: fix test: duplicated IDs

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


The following commit(s) were added to refs/heads/master by this push:
     new 202d391  fix test: duplicated IDs
202d391 is described below

commit 202d391f4e1d8240674158e0d332bfe63196d575
Author: Jasmin Kroeger <ja...@irian.eu>
AuthorDate: Tue Mar 24 11:44:57 2020 +0100

    fix test: duplicated IDs
    
    The test is now searching in the iframe not longer in the document
---
 .../tobago-example-demo/src/main/webapp/script/tobago-test.js      | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tobago-example/tobago-example-demo/src/main/webapp/script/tobago-test.js b/tobago-example/tobago-example-demo/src/main/webapp/script/tobago-test.js
index 8254e2e..a809c7a 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/script/tobago-test.js
+++ b/tobago-example/tobago-example-demo/src/main/webapp/script/tobago-test.js
@@ -50,9 +50,10 @@ QUnit.test("wait for test", function (assert) {
 QUnit.test("duplicated IDs", function (assert) {
   function getDuplicatedIDs() {
     let duplicatedIDs = [];
-    const elementsWithId = document.querySelectorAll("[id]");
-    Array.prototype.forEach.call(elementsWithId, function (element, i) {
-      let sameIdElements = document.querySelectorAll("[id='" + element.id + "']");
+    let iFrame = document.getElementById("page:testframe").contentWindow.document.querySelectorAll("[id]");
+    iFrame.forEach(element => {
+      let sameIdElements = document.getElementById("page:testframe").contentWindow.document
+          .querySelectorAll("[id='" + element.id + "']");
       if (sameIdElements.length > 1) {
         duplicatedIDs.push(element.id);
       }