aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2014-07-25 15:14:38 +0200
committerStas Vilchik <vilchiks@gmail.com>2014-07-25 15:14:38 +0200
commit1ad33ceca51ff8ab54809465d5b14cf0faaed46d (patch)
tree46a55b60cd4da97a0fd91a16607fd986e3de86dc /server/sonar-web
parent82ef7888647df6b6f1914ed86199205728227deb (diff)
downloadsonarqube-1ad33ceca51ff8ab54809465d5b14cf0faaed46d.tar.gz
sonarqube-1ad33ceca51ff8ab54809465d5b14cf0faaed46d.zip
Add MTs of duplications in deleted files
Diffstat (limited to 'server/sonar-web')
-rw-r--r--server/sonar-web/src/main/hbs/component-viewer/cw-source.hbs2
-rw-r--r--server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec.js28
-rw-r--r--server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/duplications-in-deleted-files.json24
3 files changed, 53 insertions, 1 deletions
diff --git a/server/sonar-web/src/main/hbs/component-viewer/cw-source.hbs b/server/sonar-web/src/main/hbs/component-viewer/cw-source.hbs
index 79c44c4460f..e8f68051bf9 100644
--- a/server/sonar-web/src/main/hbs/component-viewer/cw-source.hbs
+++ b/server/sonar-web/src/main/hbs/component-viewer/cw-source.hbs
@@ -5,7 +5,7 @@
{{else}}
{{#if state.duplicationsInDeletedFiles}}
- <p class="marginbottom10">{{t 'duplications.dups_found_on_deleted_resource'}}</p>
+ <p class="marginbottom10 js-duplications-in-deleted-files">{{t 'duplications.dups_found_on_deleted_resource'}}</p>
{{/if}}
{{#if issuesLimitReached}}
diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec.js b/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec.js
index a04562aa1e3..d01f7992644 100644
--- a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec.js
+++ b/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec.js
@@ -503,3 +503,31 @@ casper.test.begin(testName('Cross-Project Duplications'), function (test) {
test.done();
});
});
+
+
+casper.test.begin(testName('Duplications in Deleted Files'), function (test) {
+ casper
+ .start(lib.buildUrl('component-viewer#component=component'), function () {
+ lib.setDefaultViewport();
+ lib.mockRequest('/api/l10n/index', '{}');
+ lib.mockRequestFromFile('/api/components/app', 'app.json');
+ lib.mockRequestFromFile('/api/sources/show', 'source.json');
+ lib.mockRequestFromFile('/api/resources', 'resources.json');
+ lib.mockRequestFromFile('/api/duplications/show', 'duplications-in-deleted-files.json');
+ })
+
+ .then(function () {
+ casper.waitForSelector('.component-viewer-source .row');
+ })
+
+ .then(function () {
+ casper.click('.js-toggle-duplications');
+ casper.waitForSelector('.duplication-exists', function () {
+ test.assertExists('.js-duplications-in-deleted-files');
+ });
+ })
+
+ .run(function () {
+ test.done();
+ });
+});
diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/duplications-in-deleted-files.json b/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/duplications-in-deleted-files.json
new file mode 100644
index 00000000000..9de23d1ce7d
--- /dev/null
+++ b/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/duplications-in-deleted-files.json
@@ -0,0 +1,24 @@
+{"duplications": [
+ {
+ "blocks": [
+ {
+ "from": 404,
+ "size": 15,
+ "_ref": "1"
+ },
+ {
+ "from": 455,
+ "size": 15
+ }
+ ]
+ }
+], "files": {
+ "1": {
+ "key": "org.codehaus.sonar:sonar-batch:src/main/java/org/sonar/batch/index/Cache.java",
+ "name": "src/main/java/org/sonar/batch/index/Cache.java",
+ "project": "org.codehaus.sonar:sonar",
+ "projectName": "SonarQube",
+ "subProject": "org.codehaus.sonar:sonar-batch",
+ "subProjectName": "SonarQube :: Batch"
+ }
+}}