aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/test
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2015-07-02 19:10:05 +0200
committerStas Vilchik <vilchiks@gmail.com>2015-07-02 19:10:13 +0200
commiteacc42330748df1c39fc833067ad3e1ac9a9890c (patch)
tree687dbef6612db7736af9e7985770f743dba7b0ae /server/sonar-web/test
parent46e6215a46a19a0b4355116ccd18b4dbdf6ca366 (diff)
downloadsonarqube-eacc42330748df1c39fc833067ad3e1ac9a9890c.tar.gz
sonarqube-eacc42330748df1c39fc833067ad3e1ac9a9890c.zip
add a couple of issues web tests
Diffstat (limited to 'server/sonar-web/test')
-rw-r--r--server/sonar-web/test/medium/issues.spec.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/server/sonar-web/test/medium/issues.spec.js b/server/sonar-web/test/medium/issues.spec.js
index c03852901fc..8e5773b3e2d 100644
--- a/server/sonar-web/test/medium/issues.spec.js
+++ b/server/sonar-web/test/medium/issues.spec.js
@@ -214,6 +214,37 @@ define(function (require) {
.clickElement('.bubble-popup [data-property="severities"]')
.checkElementCount('.issue', 17);
});
+
+ bdd.it('should open issue permalink', function () {
+ var issueKey = 'some-issue-key';
+
+ return this.remote
+ .get(require.toUrl('test/medium/base.html#issues=' + issueKey))
+ .mockFromString('/api/l10n/index', '{}')
+ .mockFromFile('/api/issue_filters/app', 'issues-page-should-open-issue-permalink/app.json')
+ .mockFromString('/api/issues/search', {}, { data: { issues: issueKey, p: 2 } })
+ .mockFromFile('/api/issues/search', 'issues-page-should-open-issue-permalink/search.json',
+ { data: { issues: issueKey } })
+ .mockFromFile('/api/components/app', 'issues-page-should-open-issue-permalink/components-app.json')
+ .mockFromFile('/api/sources/lines', 'issues-page-should-open-issue-permalink/lines.json')
+ .startApp('issues')
+ .checkElementExist('.source-line')
+ .checkElementInclude('.source-viewer', 'public void executeOn(Project project, SensorContext context')
+ .checkElementCount('.issue', 1)
+ .checkElementCount('.issue[data-key="' + issueKey + '"]', 1);
+ });
+
+ bdd.it('should open closed facet', function () {
+ return this.remote
+ .get(require.toUrl('test/medium/base.html'))
+ .mockFromString('/api/l10n/index', '{}')
+ .mockFromFile('/api/issue_filters/app', 'issues-spec/app.json')
+ .mockFromFile('/api/issues/search', 'issues-spec/search.json')
+ .startApp('issues')
+ .clickElement('[data-property="rules"] .js-facet-toggle')
+ .checkElementCount('[data-property="rules"] .js-facet', 15)
+ .checkElementInclude('[data-property="rules"] .js-facet:nth-child(1)', 'Statements should be on separate');
+ });
});
});