]> source.dussan.org Git - sonarqube.git/blob
49406ab01ee03cc167f97b374830e3ad20c7dea7
[sonarqube.git] /
1 /* global casper:false */
2
3 var lib = require('../lib'),
4     testName = lib.testName('Source Viewer');
5
6 lib.initMessages();
7 lib.changeWorkingDirectory('source-viewer-should-not-show-source-if-no-permission');
8
9
10 casper.test.begin(testName('source-viewer-should-not-show-source-if-no-permission'), function (test) {
11   casper
12       .start(lib.buildUrl('source-viewer'), function () {
13         lib.setDefaultViewport();
14
15         lib.mockRequest('/api/l10n/index', '{}');
16         lib.mockRequestFromFile('/api/components/app', 'api-components-app.json');
17         lib.mockRequest('/api/sources/lines', '{}', { status: 403 });
18         lib.mockRequestFromFile('/api/issues/search', 'api-issues-search.json');
19       })
20
21       .then(function () {
22         casper.waitForSelector('.message-error', function () {
23           test.assertDoesntExist('.source-line');
24         });
25       })
26
27       .run(function () {
28         test.done();
29       });
30 });