aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2015-04-10 14:42:39 +0200
committerStas Vilchik <vilchiks@gmail.com>2015-04-10 14:45:20 +0200
commita196b0add9ab3f133d914db1bacf9350e8ee1ea7 (patch)
tree29b93cf1b848f5f8236d5876868e248a3ff19c8c
parent52a0578e61c4e9d8496b2e77ea5cabb95c1d5a72 (diff)
downloadsonarqube-a196b0add9ab3f133d914db1bacf9350e8ee1ea7.tar.gz
sonarqube-a196b0add9ab3f133d914db1bacf9350e8ee1ea7.zip
SONAR-5851 add tests
-rw-r--r--server/sonar-web/src/main/js/quality-profiles/app.js9
-rw-r--r--server/sonar-web/src/main/js/quality-profiles/profile-view.js1
-rw-r--r--server/sonar-web/src/test/js/quality-profiles.js489
-rw-r--r--server/sonar-web/src/test/json/quality-profiles/create.json12
-rw-r--r--server/sonar-web/src/test/json/quality-profiles/languages.json20
-rw-r--r--server/sonar-web/src/test/json/quality-profiles/projects.json15
-rw-r--r--server/sonar-web/src/test/json/quality-profiles/rules.json33
-rw-r--r--server/sonar-web/src/test/json/quality-profiles/search-another-default.json49
-rw-r--r--server/sonar-web/src/test/json/quality-profiles/search-modified.json12
-rw-r--r--server/sonar-web/src/test/json/quality-profiles/search-renamed.json48
-rw-r--r--server/sonar-web/src/test/json/quality-profiles/search-with-copy.json56
-rw-r--r--server/sonar-web/src/test/json/quality-profiles/search.json48
-rw-r--r--server/sonar-web/src/test/views/quality_profiles.jade5
13 files changed, 796 insertions, 1 deletions
diff --git a/server/sonar-web/src/main/js/quality-profiles/app.js b/server/sonar-web/src/main/js/quality-profiles/app.js
index 9fe2f97ac10..8cf66d6bf15 100644
--- a/server/sonar-web/src/main/js/quality-profiles/app.js
+++ b/server/sonar-web/src/main/js/quality-profiles/app.js
@@ -57,7 +57,7 @@ require([
this.router = new Router({ app: this });
Backbone.history.start({
pushState: true,
- root: baseUrl + '/quality_profiles'
+ root: getRoot()
});
});
@@ -66,4 +66,11 @@ require([
App.start();
});
+ function getRoot () {
+ var QUALITY_PROFILES = '/quality_profiles',
+ path = window.location.pathname,
+ pos = path.indexOf(QUALITY_PROFILES);
+ return path.substr(0, pos + QUALITY_PROFILES.length);
+ }
+
});
diff --git a/server/sonar-web/src/main/js/quality-profiles/profile-view.js b/server/sonar-web/src/main/js/quality-profiles/profile-view.js
index 8739aec7faf..a2983d17729 100644
--- a/server/sonar-web/src/main/js/quality-profiles/profile-view.js
+++ b/server/sonar-web/src/main/js/quality-profiles/profile-view.js
@@ -36,6 +36,7 @@ define([
onRender: function () {
this.$el.toggleClass('active', this.options.highlighted);
+ this.$el.attr('data-key', this.model.id);
},
onClick: function (e) {
diff --git a/server/sonar-web/src/test/js/quality-profiles.js b/server/sonar-web/src/test/js/quality-profiles.js
new file mode 100644
index 00000000000..3b04b0b06f7
--- /dev/null
+++ b/server/sonar-web/src/test/js/quality-profiles.js
@@ -0,0 +1,489 @@
+/*
+ * SonarQube, open source software quality management tool.
+ * Copyright (C) 2008-2014 SonarSource
+ * mailto:contact AT sonarsource DOT com
+ *
+ * SonarQube is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * SonarQube is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+/* global casper:false */
+
+var lib = require('../lib'),
+ testName = lib.testName('Quality Profiles');
+
+lib.initMessages();
+lib.changeWorkingDirectory('quality-profiles');
+lib.configureCasper();
+
+
+casper.test.begin(testName('Should Show List'), 9, function (test) {
+ casper
+ .start(lib.buildUrl('quality_profiles'), function () {
+ lib.setDefaultViewport();
+
+ lib.mockRequestFromFile('/api/qualityprofiles/search', 'search.json');
+ })
+
+ .then(function () {
+ casper.evaluate(function () {
+ require(['/js/quality-profiles/app.js']);
+ });
+ })
+
+ .then(function () {
+ casper.waitForSelector('.js-list .list-group-item');
+ })
+
+ .then(function () {
+ test.assertElementCount('.js-list .list-group-item', 5);
+ test.assertSelectorContains('.js-list .list-group-item', 'Sonar way');
+ test.assertSelectorContains('.js-list .list-group-item', 'PSR-2');
+
+ test.assertElementCount('.js-list-language', 4);
+ test.assertSelectorContains('.js-list-language', 'Java');
+ test.assertSelectorContains('.js-list-language', 'JavaScript');
+ test.assertSelectorContains('.js-list-language', 'PHP');
+ test.assertSelectorContains('.js-list-language', 'Python');
+
+ test.assertElementCount('.js-list .note', 4);
+ })
+
+ .then(function () {
+ lib.sendCoverage();
+ })
+
+ .run(function () {
+ test.done();
+ });
+});
+
+
+casper.test.begin(testName('Should Show Details'), 9, function (test) {
+ casper
+ .start(lib.buildUrl('quality_profiles'), function () {
+ lib.setDefaultViewport();
+
+ lib.mockRequestFromFile('/api/qualityprofiles/search', 'search.json');
+ lib.mockRequestFromFile('/api/rules/search', 'rules.json');
+ })
+
+ .then(function () {
+ casper.evaluate(function () {
+ require(['/js/quality-profiles/app.js']);
+ });
+ })
+
+ .then(function () {
+ casper.waitForSelector('.js-list .list-group-item');
+ })
+
+ .then(function () {
+ casper.click('.js-list .list-group-item');
+ casper.waitForSelector('.search-navigator-header-component');
+ })
+
+ .then(function () {
+ test.assertElementCount('.js-list .list-group-item.active', 1);
+ test.assertSelectorContains('.js-list .list-group-item.active', 'Sonar way');
+
+ test.assertSelectorContains('.search-navigator-workspace-header', 'Sonar way');
+ test.assertSelectorContains('.search-navigator-workspace-header', 'Java');
+ test.assertExists('#quality-profile-backup');
+ test.assertExists('#quality-profile-rename');
+ test.assertExists('#quality-profile-copy');
+ test.assertDoesntExist('#quality-profile-delete');
+ test.assertDoesntExist('#quality-profile-set-as-default');
+ })
+
+ .then(function () {
+ lib.sendCoverage();
+ })
+
+ .run(function () {
+ test.done();
+ });
+});
+
+
+casper.test.begin(testName('Should Show Selected Projects'), 2, function (test) {
+ casper
+ .start(lib.buildUrl('quality_profiles'), function () {
+ lib.setDefaultViewport();
+
+ lib.mockRequestFromFile('/api/qualityprofiles/search', 'search.json');
+ lib.mockRequestFromFile('/api/rules/search', 'rules.json');
+ lib.mockRequestFromFile('/api/qualityprofiles/projects*', 'projects.json');
+ })
+
+ .then(function () {
+ casper.evaluate(function () {
+ require(['/js/quality-profiles/app.js']);
+ });
+ })
+
+ .then(function () {
+ casper.waitForSelector('.js-list .list-group-item');
+ })
+
+ .then(function () {
+ casper.click('.js-list .list-group-item[data-key="php-psr-2-46772"]');
+ casper.waitForSelector('#quality-profile-projects');
+ })
+
+ .then(function () {
+ lib.waitForElementCount('#quality-profile-projects .select-list-list li', 2);
+ })
+
+ .then(function () {
+ test.assertSelectorContains('#quality-profile-projects .select-list-list li', 'CSS');
+ test.assertSelectorContains('#quality-profile-projects .select-list-list li', 'http-request-parent');
+ })
+
+ .then(function () {
+ lib.sendCoverage();
+ })
+
+ .run(function () {
+ test.done();
+ });
+});
+
+
+casper.test.begin(testName('Copy Profile'), 5, function (test) {
+ casper
+ .start(lib.buildUrl('quality_profiles'), function () {
+ lib.setDefaultViewport();
+
+ this.searchMock = lib.mockRequestFromFile('/api/qualityprofiles/search', 'search.json');
+ lib.mockRequestFromFile('/api/rules/search', 'rules.json');
+ lib.mockRequest('/api/qualityprofiles/copy', '{}');
+ })
+
+ .then(function () {
+ casper.evaluate(function () {
+ require(['/js/quality-profiles/app.js']);
+ jQuery.ajaxSetup({ dataType: 'json' });
+ });
+ })
+
+ .then(function () {
+ casper.waitForSelector('.js-list .list-group-item');
+ })
+
+ .then(function () {
+ test.assertElementCount('.js-list .list-group-item', 5);
+ casper.click('.js-list .list-group-item[data-key="java-sonar-way-67887"]');
+ casper.waitForSelector('#quality-profile-copy');
+ })
+
+ .then(function () {
+ casper.click('#quality-profile-copy');
+ casper.waitForSelector('.modal');
+ })
+
+ .then(function () {
+ lib.clearRequestMock(this.searchMock);
+ lib.mockRequestFromFile('/api/qualityprofiles/search', 'search-with-copy.json');
+
+ casper.evaluate(function () {
+ jQuery('#copy-name').val('Copied Profile');
+ });
+ casper.click('#copy-submit');
+ casper.waitForSelectorTextChange('.search-navigator-header-component');
+ })
+
+ .then(function () {
+ test.assertElementCount('.js-list .list-group-item', 6);
+ test.assertSelectorContains('.js-list .list-group-item.active', 'Copied Profile');
+ test.assertSelectorContains('.search-navigator-header-component', 'Copied Profile');
+ test.assertSelectorContains('.search-navigator-header-component', 'Java');
+ })
+
+ .then(function () {
+ lib.sendCoverage();
+ })
+
+ .run(function () {
+ test.done();
+ });
+});
+
+
+casper.test.begin(testName('Rename Profile'), 2, function (test) {
+ casper
+ .start(lib.buildUrl('quality_profiles'), function () {
+ lib.setDefaultViewport();
+
+ this.searchMock = lib.mockRequestFromFile('/api/qualityprofiles/search', 'search.json');
+ lib.mockRequestFromFile('/api/rules/search', 'rules.json');
+ lib.mockRequest('/api/qualityprofiles/rename', '{}');
+ })
+
+ .then(function () {
+ casper.evaluate(function () {
+ require(['/js/quality-profiles/app.js']);
+ jQuery.ajaxSetup({ dataType: 'json' });
+ });
+ })
+
+ .then(function () {
+ casper.waitForSelector('.js-list .list-group-item');
+ })
+
+ .then(function () {
+ casper.click('.js-list .list-group-item[data-key="java-sonar-way-67887"]');
+ casper.waitForSelector('#quality-profile-rename');
+ })
+
+ .then(function () {
+ casper.click('#quality-profile-rename');
+ casper.waitForSelector('.modal');
+ })
+
+ .then(function () {
+ lib.clearRequestMock(this.searchMock);
+ lib.mockRequestFromFile('/api/qualityprofiles/search', 'search-renamed.json');
+
+ casper.evaluate(function () {
+ jQuery('#new-name').val('Renamed Profile');
+ });
+ casper.click('#rename-submit');
+ casper.waitForSelectorTextChange('.search-navigator-header-component');
+ })
+
+ .then(function () {
+ test.assertSelectorContains('.js-list .list-group-item.active', 'Renamed Profile');
+ test.assertSelectorContains('.search-navigator-header-component', 'Renamed Profile');
+ })
+
+ .then(function () {
+ lib.sendCoverage();
+ })
+
+ .run(function () {
+ test.done();
+ });
+});
+
+
+casper.test.begin(testName('Make Profile Default'), 4, function (test) {
+ casper
+ .start(lib.buildUrl('quality_profiles'), function () {
+ lib.setDefaultViewport();
+
+ this.searchMock = lib.mockRequestFromFile('/api/qualityprofiles/search', 'search.json');
+ lib.mockRequestFromFile('/api/rules/search', 'rules.json');
+ lib.mockRequest('/api/qualityprofiles/set_default', '{}');
+ })
+
+ .then(function () {
+ casper.evaluate(function () {
+ require(['/js/quality-profiles/app.js']);
+ jQuery.ajaxSetup({ dataType: 'json' });
+ });
+ })
+
+ .then(function () {
+ casper.waitForSelector('.js-list .list-group-item');
+ })
+
+ .then(function () {
+ test.assertDoesntExist('.js-list .list-group-item[data-key="php-psr-2-46772"] .note');
+ test.assertExists('.js-list .list-group-item[data-key="php-sonar-way-10778"] .note');
+ casper.click('.js-list .list-group-item[data-key="php-psr-2-46772"]');
+ casper.waitForSelector('#quality-profile-set-as-default');
+ })
+
+ .then(function () {
+ lib.clearRequestMock(this.searchMock);
+ lib.mockRequestFromFile('/api/qualityprofiles/search', 'search-another-default.json');
+
+ casper.click('#quality-profile-set-as-default');
+ casper.waitWhileSelector('.js-list .list-group-item[data-key="php-sonar-way-10778"] .note');
+ })
+
+ .then(function () {
+ test.assertDoesntExist('#quality-profile-set-as-default');
+ test.assertExists('.js-list .list-group-item[data-key="php-psr-2-46772"] .note');
+ })
+
+ .then(function () {
+ lib.sendCoverage();
+ })
+
+ .run(function () {
+ test.done();
+ });
+});
+
+
+casper.test.begin(testName('Delete Profile'), 2, function (test) {
+ casper
+ .start(lib.buildUrl('quality_profiles'), function () {
+ lib.setDefaultViewport();
+
+ this.searchMock = lib.mockRequestFromFile('/api/qualityprofiles/search', 'search-with-copy.json');
+ lib.mockRequestFromFile('/api/rules/search', 'rules.json');
+ lib.mockRequest('/api/qualityprofiles/delete', '{}');
+ })
+
+ .then(function () {
+ casper.evaluate(function () {
+ require(['/js/quality-profiles/app.js']);
+ jQuery.ajaxSetup({ dataType: 'json' });
+ });
+ })
+
+ .then(function () {
+ casper.waitForSelector('.js-list .list-group-item');
+ })
+
+ .then(function () {
+ test.assertElementCount('.js-list .list-group-item', 6);
+ casper.click('.js-list .list-group-item[data-key="java-copied-profile-11711"]');
+ casper.waitForSelector('#quality-profile-delete');
+ })
+
+ .then(function () {
+ casper.click('#quality-profile-delete');
+ casper.waitForSelector('.modal');
+ })
+
+ .then(function () {
+ lib.clearRequestMock(this.searchMock);
+ lib.mockRequestFromFile('/api/qualityprofiles/search', 'search.json');
+
+ casper.click('#delete-submit');
+ lib.waitForElementCount('.js-list .list-group-item', 5);
+ })
+
+ .then(function () {
+ test.assertSelectorDoesntContain('.js-list .list-group-item', 'Copied Profile');
+ })
+
+ .then(function () {
+ lib.sendCoverage();
+ })
+
+ .run(function () {
+ test.done();
+ });
+});
+
+
+casper.test.begin(testName('Create Profile'), 2, function (test) {
+ casper
+ .start(lib.buildUrl('quality_profiles'), function () {
+ lib.setDefaultViewport();
+
+ this.searchMock = lib.mockRequestFromFile('/api/qualityprofiles/search', 'search.json');
+ lib.mockRequestFromFile('/api/rules/search', 'rules.json');
+ lib.mockRequestFromFile('/api/qualityprofiles/create', 'create.json');
+ lib.mockRequestFromFile('/api/languages/list', 'languages.json');
+ })
+
+ .then(function () {
+ casper.evaluate(function () {
+ require(['/js/quality-profiles/app.js']);
+ jQuery.ajaxSetup({ dataType: 'json' });
+ });
+ })
+
+ .then(function () {
+ casper.waitForSelector('.js-list .list-group-item');
+ })
+
+ .then(function () {
+ test.assertElementCount('.js-list .list-group-item', 5);
+ casper.click('#quality-profiles-create');
+ casper.waitForSelector('.modal');
+ })
+
+ .then(function () {
+ lib.clearRequestMock(this.searchMock);
+ lib.mockRequestFromFile('/api/qualityprofiles/search', 'search-with-copy.json');
+
+ casper.evaluate(function () {
+ jQuery('#create-profile-name').val('Copied Profile');
+ jQuery('#create-profile-language').val('java');
+ });
+ casper.click('#create-profile-submit');
+ lib.waitForElementCount('.js-list .list-group-item', 6);
+ })
+
+ .then(function () {
+ test.assertExists('.js-list .list-group-item.active[data-key="java-copied-profile-11711"]');
+ })
+
+ .then(function () {
+ lib.sendCoverage();
+ })
+
+ .run(function () {
+ test.done();
+ });
+});
+
+
+casper.test.begin(testName('Restore Built-in Profiles'), 2, function (test) {
+ casper
+ .start(lib.buildUrl('quality_profiles'), function () {
+ lib.setDefaultViewport();
+
+ this.searchMock = lib.mockRequestFromFile('/api/qualityprofiles/search', 'search-modified.json');
+ lib.mockRequestFromFile('/api/rules/search', 'rules.json');
+ lib.mockRequest('/api/qualityprofiles/restore_built_in', '{}');
+ lib.mockRequestFromFile('/api/languages/list', 'languages.json');
+ })
+
+ .then(function () {
+ casper.evaluate(function () {
+ require(['/js/quality-profiles/app.js']);
+ jQuery.ajaxSetup({ dataType: 'json' });
+ });
+ })
+
+ .then(function () {
+ casper.waitForSelector('.js-list .list-group-item');
+ })
+
+ .then(function () {
+ test.assertElementCount('.js-list .list-group-item', 1);
+ casper.click('#quality-profiles-restore-built-in');
+ casper.waitForSelector('.modal');
+ })
+
+ .then(function () {
+ lib.clearRequestMock(this.searchMock);
+ lib.mockRequestFromFile('/api/qualityprofiles/search', 'search.json');
+
+ casper.evaluate(function () {
+ jQuery('#restore-built-in-profiles-language').val('java');
+ });
+ casper.click('#restore-built-in-profiles-submit');
+ lib.waitForElementCount('.js-list .list-group-item', 5);
+ })
+
+ .then(function () {
+ test.assertSelectorContains('.js-list .list-group-item', 'Sonar way');
+ })
+
+ .then(function () {
+ lib.sendCoverage();
+ })
+
+ .run(function () {
+ test.done();
+ });
+});
diff --git a/server/sonar-web/src/test/json/quality-profiles/create.json b/server/sonar-web/src/test/json/quality-profiles/create.json
new file mode 100644
index 00000000000..357d814db6a
--- /dev/null
+++ b/server/sonar-web/src/test/json/quality-profiles/create.json
@@ -0,0 +1,12 @@
+{
+ "profile": {
+ "key": "java-copied-profile-11711",
+ "name": "Copied Profile",
+ "activeRuleCount": 161,
+ "language": "java",
+ "languageName": "Java",
+ "isInherited": false
+ }
+}
+
+
diff --git a/server/sonar-web/src/test/json/quality-profiles/languages.json b/server/sonar-web/src/test/json/quality-profiles/languages.json
new file mode 100644
index 00000000000..7a408e75ecb
--- /dev/null
+++ b/server/sonar-web/src/test/json/quality-profiles/languages.json
@@ -0,0 +1,20 @@
+{
+ "languages": [
+ {
+ "key": "java",
+ "name": "Java"
+ },
+ {
+ "key": "js",
+ "name": "JavaScript"
+ },
+ {
+ "key": "php",
+ "name": "PHP"
+ },
+ {
+ "key": "py",
+ "name": "Python"
+ }
+ ]
+}
diff --git a/server/sonar-web/src/test/json/quality-profiles/projects.json b/server/sonar-web/src/test/json/quality-profiles/projects.json
new file mode 100644
index 00000000000..39c951e89ab
--- /dev/null
+++ b/server/sonar-web/src/test/json/quality-profiles/projects.json
@@ -0,0 +1,15 @@
+{
+ "results": [
+ {
+ "key": "f140a877-8ab9-4eba-bb7e-7e0e0ec26129",
+ "name": "CSS",
+ "selected": true
+ },
+ {
+ "key": "fd68ca9a-f8cb-4e9b-8379-8d054e43b3ab",
+ "name": "http-request-parent",
+ "selected": true
+ }
+ ],
+ "more": false
+}
diff --git a/server/sonar-web/src/test/json/quality-profiles/rules.json b/server/sonar-web/src/test/json/quality-profiles/rules.json
new file mode 100644
index 00000000000..24ec2be7dcd
--- /dev/null
+++ b/server/sonar-web/src/test/json/quality-profiles/rules.json
@@ -0,0 +1,33 @@
+{
+ "total": 161,
+ "p": 1,
+ "ps": 1,
+ "rules": [],
+ "facets": [
+ {
+ "property": "severities",
+ "values": [
+ {
+ "val": "MAJOR",
+ "count": 90
+ },
+ {
+ "val": "CRITICAL",
+ "count": 41
+ },
+ {
+ "val": "MINOR",
+ "count": 16
+ },
+ {
+ "val": "BLOCKER",
+ "count": 12
+ },
+ {
+ "val": "INFO",
+ "count": 2
+ }
+ ]
+ }
+ ]
+}
diff --git a/server/sonar-web/src/test/json/quality-profiles/search-another-default.json b/server/sonar-web/src/test/json/quality-profiles/search-another-default.json
new file mode 100644
index 00000000000..30b1d40419d
--- /dev/null
+++ b/server/sonar-web/src/test/json/quality-profiles/search-another-default.json
@@ -0,0 +1,49 @@
+{
+ "profiles": [
+ {
+ "key": "java-sonar-way-67887",
+ "name": "Sonar way",
+ "activeRuleCount": 161,
+ "language": "java",
+ "languageName": "Java",
+ "isInherited": false,
+ "isDefault": true
+ },
+ {
+ "key": "js-sonar-way-71566",
+ "name": "Sonar way",
+ "activeRuleCount": 63,
+ "language": "js",
+ "languageName": "JavaScript",
+ "isInherited": false,
+ "isDefault": true
+ },
+ {
+ "key": "php-psr-2-46772",
+ "name": "PSR-2",
+ "activeRuleCount": 19,
+ "language": "php",
+ "languageName": "PHP",
+ "isInherited": false,
+ "isDefault": true
+ },
+ {
+ "key": "php-sonar-way-10778",
+ "name": "Sonar way",
+ "activeRuleCount": 59,
+ "language": "php",
+ "languageName": "PHP",
+ "isInherited": false,
+ "isDefault": false
+ },
+ {
+ "key": "py-sonar-way-78627",
+ "name": "Sonar way",
+ "activeRuleCount": 21,
+ "language": "py",
+ "languageName": "Python",
+ "isInherited": false,
+ "isDefault": true
+ }
+ ]
+}
diff --git a/server/sonar-web/src/test/json/quality-profiles/search-modified.json b/server/sonar-web/src/test/json/quality-profiles/search-modified.json
new file mode 100644
index 00000000000..1ef80b6085a
--- /dev/null
+++ b/server/sonar-web/src/test/json/quality-profiles/search-modified.json
@@ -0,0 +1,12 @@
+{
+ "profiles": [
+ {
+ "key": "php-psr-2-46772",
+ "name": "PSR-2",
+ "activeRuleCount": 19,
+ "language": "php",
+ "languageName": "PHP",
+ "isInherited": false
+ }
+ ]
+}
diff --git a/server/sonar-web/src/test/json/quality-profiles/search-renamed.json b/server/sonar-web/src/test/json/quality-profiles/search-renamed.json
new file mode 100644
index 00000000000..3915cdfe3e8
--- /dev/null
+++ b/server/sonar-web/src/test/json/quality-profiles/search-renamed.json
@@ -0,0 +1,48 @@
+{
+ "profiles": [
+ {
+ "key": "java-sonar-way-67887",
+ "name": "Renamed Profile",
+ "activeRuleCount": 161,
+ "language": "java",
+ "languageName": "Java",
+ "isInherited": false,
+ "isDefault": true
+ },
+ {
+ "key": "js-sonar-way-71566",
+ "name": "Sonar way",
+ "activeRuleCount": 63,
+ "language": "js",
+ "languageName": "JavaScript",
+ "isInherited": false,
+ "isDefault": true
+ },
+ {
+ "key": "php-psr-2-46772",
+ "name": "PSR-2",
+ "activeRuleCount": 19,
+ "language": "php",
+ "languageName": "PHP",
+ "isInherited": false
+ },
+ {
+ "key": "php-sonar-way-10778",
+ "name": "Sonar way",
+ "activeRuleCount": 59,
+ "language": "php",
+ "languageName": "PHP",
+ "isInherited": false,
+ "isDefault": true
+ },
+ {
+ "key": "py-sonar-way-78627",
+ "name": "Sonar way",
+ "activeRuleCount": 21,
+ "language": "py",
+ "languageName": "Python",
+ "isInherited": false,
+ "isDefault": true
+ }
+ ]
+}
diff --git a/server/sonar-web/src/test/json/quality-profiles/search-with-copy.json b/server/sonar-web/src/test/json/quality-profiles/search-with-copy.json
new file mode 100644
index 00000000000..1df52c4b84b
--- /dev/null
+++ b/server/sonar-web/src/test/json/quality-profiles/search-with-copy.json
@@ -0,0 +1,56 @@
+{
+ "profiles": [
+ {
+ "key": "java-copied-profile-11711",
+ "name": "Copied Profile",
+ "activeRuleCount": 161,
+ "language": "java",
+ "languageName": "Java",
+ "isInherited": false
+ },
+ {
+ "key": "java-sonar-way-67887",
+ "name": "Sonar way",
+ "activeRuleCount": 161,
+ "language": "java",
+ "languageName": "Java",
+ "isInherited": false,
+ "isDefault": true
+ },
+ {
+ "key": "js-sonar-way-71566",
+ "name": "Sonar way",
+ "activeRuleCount": 63,
+ "language": "js",
+ "languageName": "JavaScript",
+ "isInherited": false,
+ "isDefault": true
+ },
+ {
+ "key": "php-psr-2-46772",
+ "name": "PSR-2",
+ "activeRuleCount": 19,
+ "language": "php",
+ "languageName": "PHP",
+ "isInherited": false
+ },
+ {
+ "key": "php-sonar-way-10778",
+ "name": "Sonar way",
+ "activeRuleCount": 59,
+ "language": "php",
+ "languageName": "PHP",
+ "isInherited": false,
+ "isDefault": true
+ },
+ {
+ "key": "py-sonar-way-78627",
+ "name": "Sonar way",
+ "activeRuleCount": 21,
+ "language": "py",
+ "languageName": "Python",
+ "isInherited": false,
+ "isDefault": true
+ }
+ ]
+}
diff --git a/server/sonar-web/src/test/json/quality-profiles/search.json b/server/sonar-web/src/test/json/quality-profiles/search.json
new file mode 100644
index 00000000000..c9b44c80656
--- /dev/null
+++ b/server/sonar-web/src/test/json/quality-profiles/search.json
@@ -0,0 +1,48 @@
+{
+ "profiles": [
+ {
+ "key": "java-sonar-way-67887",
+ "name": "Sonar way",
+ "activeRuleCount": 161,
+ "language": "java",
+ "languageName": "Java",
+ "isInherited": false,
+ "isDefault": true
+ },
+ {
+ "key": "js-sonar-way-71566",
+ "name": "Sonar way",
+ "activeRuleCount": 63,
+ "language": "js",
+ "languageName": "JavaScript",
+ "isInherited": false,
+ "isDefault": true
+ },
+ {
+ "key": "php-psr-2-46772",
+ "name": "PSR-2",
+ "activeRuleCount": 19,
+ "language": "php",
+ "languageName": "PHP",
+ "isInherited": false
+ },
+ {
+ "key": "php-sonar-way-10778",
+ "name": "Sonar way",
+ "activeRuleCount": 59,
+ "language": "php",
+ "languageName": "PHP",
+ "isInherited": false,
+ "isDefault": true
+ },
+ {
+ "key": "py-sonar-way-78627",
+ "name": "Sonar way",
+ "activeRuleCount": 21,
+ "language": "py",
+ "languageName": "Python",
+ "isInherited": false,
+ "isDefault": true
+ }
+ ]
+}
diff --git a/server/sonar-web/src/test/views/quality_profiles.jade b/server/sonar-web/src/test/views/quality_profiles.jade
new file mode 100644
index 00000000000..e17181b0953
--- /dev/null
+++ b/server/sonar-web/src/test/views/quality_profiles.jade
@@ -0,0 +1,5 @@
+extends layouts/main
+
+block body
+ #content
+ .search-navigator#quality-profiles