diff options
author | Thomas Steur <thomas.steur@googlemail.com> | 2014-09-10 16:25:08 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@googlemail.com> | 2014-09-10 16:25:08 +0400 |
commit | df65e0dd10f12e11990665971e5f7e019168fd39 (patch) | |
tree | 3d24bb805a37e4dde51ae8de10884e821b501338 /tests/javascript/content-fixtures | |
parent | 7ad02af8bef3eff12624925c4521feaab9f98aae (diff) |
refs #4996 many new tests and many bugfixes. Tests should be done now except for cross browser support. I fixed many issues as I did not consider that link tracking may be disabled or enabled and the behavior should be different in such a case.
Diffstat (limited to 'tests/javascript/content-fixtures')
3 files changed, 38 insertions, 4 deletions
diff --git a/tests/javascript/content-fixtures/contentUtilities.html b/tests/javascript/content-fixtures/contentUtilities.html index e9a3e83b99..4db210e5ae 100644 --- a/tests/javascript/content-fixtures/contentUtilities.html +++ b/tests/javascript/content-fixtures/contentUtilities.html @@ -21,6 +21,24 @@ <a href="http://www.example.com" class="piwikContentTarget">Link</a> </div> + +<!-- test to make sure only clicked elements within target node are authorized --> +<!-- authorized because content block is target and a link is within --> +<div id="authorized1" data-track-content> + <a id="authorized1_1" href="http://www.example.com">Link</a> +</div> +<!-- authorized because span is within target --> +<div id="authorized2" data-track-content> + <a href="http://www.example.com" data-content-target id="authorized2_1">Link<span id="authorized2_2"></span></a> +</div> +<!-- not authorized because span is not in target --> +<div id="authorized3" data-track-content> + <span id="authorized3_1"></span> + <a href="http://www.example.com" data-content-target id="authorized3_2">Link</a> +</div> + + + <a href="http://www.example.com" id="aLinkToBeChanged">Link</a> <div class="media"> diff --git a/tests/javascript/content-fixtures/trackerInternals.html b/tests/javascript/content-fixtures/trackerInternals.html index acb35f4cc5..ee4494c65d 100644 --- a/tests/javascript/content-fixtures/trackerInternals.html +++ b/tests/javascript/content-fixtures/trackerInternals.html @@ -61,4 +61,20 @@ </a> <a id="ex116_hidden" href="http://www.example.com" data-track-content class="assertSize" style="display:none"> <img src="img116.jpg" data-content-piece /> -</a>
\ No newline at end of file +</a> + +<div id="ex117" data-track-content> + <a id="ignoreInternalLink" href="/internallink" class="piwikContentIgnoreInteraction" data-content-target>Link</a> +</div> + + +<a id="ex118" href="piwik.php?test=5" data-track-content>Link</a> +<a id="ex119" href="#test" data-track-content>Link</a> +<a id="ex120" href="http://www.example.com" data-track-content>Link</a> +<a id="ex121" href="/download.pdf" class="download" data-track-content>Link</a> +<div id="ex122" data-track-content> + <a id="replacedLinkWithTarget" href="/internallink" data-content-target="/test">Link</a> +</div> +<div id="ex123" data-track-content> + <a id="replacedLinkWithTarget" data-content-target="/test">Link</a> +</div> diff --git a/tests/javascript/content-fixtures/trackingContent.html b/tests/javascript/content-fixtures/trackingContent.html index e78a1f043f..8ff0918927 100644 --- a/tests/javascript/content-fixtures/trackingContent.html +++ b/tests/javascript/content-fixtures/trackingContent.html @@ -2,14 +2,14 @@ <img src="img1-en.jpg" data-track-content/> <img src="img1-en.jpg" class="piwikTrackContent"/> <!-- same as before should be ignored --> <div id="block1" style="display: none;"> - <a href="http://img2.example.com" data-track-content><img src="img2-en.jpg" data-content-piece="img.jpg"/></a> + <a href="http://img2.example.com" data-track-content id="isOutlink"><img id="isWithinOutlink" src="img2-en.jpg" data-content-piece="img.jpg"/></a> <a href="http://img3.example.com" data-track-content><img src="img3-en.jpg" data-content-piece/></a> <a href="http://img4.example.com" data-track-content><p data-content-piece="My content 4">Lorem ipsum</p></a> </div> <div id="block2"> <div id="ex5" data-track-content data-content-name="My Ad 5"> - <img src="http://img5.example.com/path/xyz.jpg" data-content-piece /> - <a href="/anylink5" data-content-target>Lorem ipsum</a> + <img src="http://img5.example.com/path/xyz.jpg" data-content-piece id="notWithinTarget" /> + <a href="/anylink5" data-content-target id="internalLink">Lorem ipsum</a> </div> <a href="http://img6.example.com" data-track-content> <img src="http://www.example.com/path/xyz.jpg" data-content-piece /> |