]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5820 Fix bug with activation parameter
authorStas Vilchik <vilchiks@gmail.com>
Wed, 7 Jan 2015 14:45:43 +0000 (15:45 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Wed, 7 Jan 2015 14:51:02 +0000 (15:51 +0100)
server/sonar-web/src/main/js/coding-rules/facets/quality-profile-facet.js
server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-quality-profile-facet.js

index aa4e510eaf60b658b7205d9055b95ab3833ac3eb..3c434fba6fe9dbec301788deebae043956fa84a2 100644 (file)
@@ -55,6 +55,13 @@ define([
       return activation === 'true' || activation === true;
     },
 
+    disable: function () {
+      var obj = { activation: null },
+          property = this.model.get('property');
+      obj[property] = null;
+      this.options.app.state.updateFilter(obj);
+    },
+
     serializeData: function () {
       return _.extend(BaseFacet.prototype.serializeData.apply(this, arguments), {
         values: this.getValues(),
index d377b4f69e275ff90398b83fe298e283bfe72727..2cdf303879da26ba878e95e9a903b4891389bc31 100644 (file)
@@ -6,7 +6,7 @@ lib.initMessages();
 lib.changeWorkingDirectory('coding-rules-page-quality-profile-facet');
 
 
-casper.test.begin('coding-rules-page-quality-profile-facet', 5, function (test) {
+casper.test.begin('coding-rules-page-quality-profile-facet', 6, function (test) {
   casper
       .start(lib.buildUrl('coding-rules'), function () {
         lib.setDefaultViewport();
@@ -39,13 +39,19 @@ casper.test.begin('coding-rules-page-quality-profile-facet', 5, function (test)
         test.assertSelectorContains('#coding-rules-total', '407');
         test.assertExists('.js-facet[data-value="java-default-with-mojo-conventions-49307"] .js-active.facet-toggle-active');
         casper.click('.js-facet[data-value="java-default-with-mojo-conventions-49307"] .js-inactive');
-        lib.capture();
         casper.waitForSelectorTextChange('#coding-rules-total');
       })
 
       .then(function () {
         test.assertSelectorContains('#coding-rules-total', '408');
         test.assertExists('.js-facet[data-value="java-default-with-mojo-conventions-49307"] .js-inactive.facet-toggle-active');
+        casper.click('[data-property="qprofile"] .js-facet-toggle');
+        lib.capture();
+        casper.waitForSelectorTextChange('#coding-rules-total');
+      })
+
+      .then(function () {
+        test.assertSelectorContains('#coding-rules-total', '609');
       })
 
       .run(function () {