diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2015-08-12 16:11:07 +0200 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2015-08-12 16:11:07 +0200 |
commit | f14a07796a04815dabde6f357de3ac87e5344d4a (patch) | |
tree | b402f1f34b3cf4195f76f840aa03b2c36c45179a /server/sonar-web/test | |
parent | 6e1cc1358f85d6ec644c972c0425b961b2a4346c (diff) | |
download | sonarqube-f14a07796a04815dabde6f357de3ac87e5344d4a.tar.gz sonarqube-f14a07796a04815dabde6f357de3ac87e5344d4a.zip |
SONAR-6764 add web tests
Diffstat (limited to 'server/sonar-web/test')
-rw-r--r-- | server/sonar-web/test/intern.js | 3 | ||||
-rw-r--r-- | server/sonar-web/test/medium/source-viewer.spec.js | 33 |
2 files changed, 35 insertions, 1 deletions
diff --git a/server/sonar-web/test/intern.js b/server/sonar-web/test/intern.js index 16b5ff93c82..42049ab87db 100644 --- a/server/sonar-web/test/intern.js +++ b/server/sonar-web/test/intern.js @@ -27,7 +27,8 @@ define(['intern'], function (intern) { 'test/medium/computation.spec', 'test/medium/coding-rules.spec', 'test/medium/custom-measures.spec', - 'test/medium/quality-profiles.spec' + 'test/medium/quality-profiles.spec', + 'test/medium/source-viewer.spec' ], tunnel: tunnel, diff --git a/server/sonar-web/test/medium/source-viewer.spec.js b/server/sonar-web/test/medium/source-viewer.spec.js new file mode 100644 index 00000000000..27a5b96057f --- /dev/null +++ b/server/sonar-web/test/medium/source-viewer.spec.js @@ -0,0 +1,33 @@ +define(function (require) { + var bdd = require('intern!bdd'); + require('../helpers/test-page'); + + bdd.describe('Source Viewer', function () { + var file = { uuid: 'uuid', key: 'key' }; + + bdd.describe('Issues', function () { + bdd.it('should show precise issue location', function () { + return this.remote + .open() + .mockFromFile('/api/components/app', 'source-viewer-spec/app.json', { data: { uuid: 'uuid' } }) + .mockFromFile('/api/sources/lines', 'source-viewer-spec/lines.json', { data: { uuid: 'uuid' } }) + .mockFromFile('/api/issues/search', + 'source-viewer-spec/issues-with-precise-location.json', + { data: { componentUuids: 'uuid' } }) + .startApp('source-viewer', { file: file }) + + .checkElementExist('.source-line-code[data-line-number="3"] .source-line-code-issue') + .checkElementInclude('.source-line-code[data-line-number="3"] .source-line-code-issue', '14 So') + + .checkElementExist('.source-line-code[data-line-number="11"] .source-line-code-issue') + .checkElementInclude('.source-line-code[data-line-number="11"] .source-line-code-issue', 'arQub') + + .checkElementExist('.source-line-code[data-line-number="18"] .source-line-code-issue') + .checkElementInclude('.source-line-code[data-line-number="18"] .source-line-code-issue', + 'ranklin Street, Fifth Floor, Boston, MA 02110-1301, USA.') + .checkElementExist('.source-line-code[data-line-number="19"] .source-line-code-issue') + .checkElementInclude('.source-line-code[data-line-number="19"] .source-line-code-issue', ' */'); + }); + }); + }); +}); |