1 /* global casper:false */
3 var lib = require('../lib'),
4 testName = lib.testName('Source Viewer');
7 lib.changeWorkingDirectory('source-viewer-should-not-show-source-if-no-permission');
10 casper.test.begin(testName('source-viewer-should-not-show-source-if-no-permission'), function (test) {
12 .start(lib.buildUrl('source-viewer'), function () {
13 lib.setDefaultViewport();
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');
22 casper.waitForSelector('.message-error', function () {
23 test.assertDoesntExist('.source-line');