aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2014-07-15 22:37:45 +0600
committerStas Vilchik <vilchiks@gmail.com>2014-07-15 22:37:57 +0600
commitc07c8261871d763b9fa51cd79cd177165104e89c (patch)
tree5ae41cd798ddcf303f751f3d88a096093da5b956 /server/sonar-web
parentc052c674249a80eb8cd2ab4e9673adfee03cbb47 (diff)
downloadsonarqube-c07c8261871d763b9fa51cd79cd177165104e89c.tar.gz
sonarqube-c07c8261871d763b9fa51cd79cd177165104e89c.zip
SONAR-5207 Add treemap zoom test
Diffstat (limited to 'server/sonar-web')
-rw-r--r--server/sonar-web/src/main/js/tests/e2e/tests/treemap-spec.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/treemap-spec.js b/server/sonar-web/src/main/js/tests/e2e/tests/treemap-spec.js
index 97af41cdb16..ea868ae93db 100644
--- a/server/sonar-web/src/main/js/tests/e2e/tests/treemap-spec.js
+++ b/server/sonar-web/src/main/js/tests/e2e/tests/treemap-spec.js
@@ -30,6 +30,7 @@ casper.test.begin('Treemap', function suite(test) {
casper.start('http://localhost:3000/pages/treemap.html', function () {
casper.evaluate(function (treemapData, resourceResponse) {
+ jQuery.mockjaxSettings.contentType = 'text/json';
jQuery.mockjax({ url: '/api/resources/index', responseText: resourceResponse });
var widget = new SonarWidgets.Treemap();
widget
@@ -56,6 +57,19 @@ casper.test.begin('Treemap', function suite(test) {
test.assertMatch(casper.getElementAttribute('.treemap-link', 'href'), /dashboard\/index/,
'Treemap cells have links to dashboards');
});
+ })
+ .then(function () {
+ casper.evaluate(function () {
+ var evt = document.createEvent('MouseEvents');
+ evt.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
+ d3.select('.treemap-cell').node().dispatchEvent(evt);
+ });
+ })
+ .then(function () {
+ casper.wait(500, function () {
+ test.assertSelectorHasText('.treemap-cell', 'Server');
+ test.assertElementCount('.treemap-cell', 25);
+ });
});
casper.run(function() {