diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2015-08-18 15:39:55 +0200 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2015-08-18 15:39:55 +0200 |
commit | 4c358f8ee89cddc977c8f1d9329c5ae22a0475c9 (patch) | |
tree | 83137c82828e93c66ad0bf52f6de98c4626ff0c9 /server/sonar-web/test | |
parent | 819ba82fd02fb62d034e27d727272bb2df9ace8e (diff) | |
download | sonarqube-4c358f8ee89cddc977c8f1d9329c5ae22a0475c9.tar.gz sonarqube-4c358f8ee89cddc977c8f1d9329c5ae22a0475c9.zip |
fix SONAR-6657 Cannot deactivate just activated rule
Diffstat (limited to 'server/sonar-web/test')
-rw-r--r-- | server/sonar-web/test/medium/coding-rules.spec.js | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/server/sonar-web/test/medium/coding-rules.spec.js b/server/sonar-web/test/medium/coding-rules.spec.js index cf50688cd96..1247b6cb763 100644 --- a/server/sonar-web/test/medium/coding-rules.spec.js +++ b/server/sonar-web/test/medium/coding-rules.spec.js @@ -920,5 +920,56 @@ define(function (require) { .checkElementExist('.coding-rules-detail-quality-profile-activate') .checkElementNotExist('.coding-rules-detail-quality-profile-deactivate'); }); + + bdd.it('should deactivate just activated rule', function () { + return this.remote + .open() + .mockFromString('/api/l10n/index', '{}') + .mockFromFile('/api/rules/app', 'coding-rules-spec/app.json') + .mockFromFile('/api/rules/search', 'coding-rules-spec/search-inactive.json', + { data: { activation: 'false' } }) + .mockFromFile('/api/rules/search', 'coding-rules-spec/search.json') + .mockFromString('/api/qualityprofiles/activate_rule', '{}', + { + data: { + profile_key: 'java-default-with-mojo-conventions-49307', + rule_key: 'common-java:FailedUnitTests' + } + }) + .mockFromString('/api/qualityprofiles/deactivate_rule', '{}', + { + data: { + profile_key: 'java-default-with-mojo-conventions-49307', + rule_key: 'common-java:FailedUnitTests' + } + }) + .startApp('coding-rules') + .checkElementExist('.coding-rule') + .clickElement('[data-property="qprofile"] .js-facet-toggle') + .checkElementExist('.js-facet[data-value="java-default-with-mojo-conventions-49307"]') + .clickElement('.js-facet[data-value="java-default-with-mojo-conventions-49307"]') + + .clickElement('.js-facet[data-value="java-default-with-mojo-conventions-49307"] .js-inactive') + .checkElementNotExist('.coding-rule-activation .icon-severity-major') + .checkElementExist('.coding-rules-detail-quality-profile-activate') + + .clickElement('.coding-rules-detail-quality-profile-activate') + .checkElementExist('.modal') + .checkElementExist('#coding-rules-quality-profile-activation-select') + .checkElementCount('#coding-rules-quality-profile-activation-select option', 1) + .checkElementExist('#coding-rules-quality-profile-activation-severity') + .clickElement('#coding-rules-quality-profile-activation-activate') + .checkElementExist('.coding-rule-activation .icon-severity-major') + .checkElementExist('.coding-rule-activation .icon-severity-major') + .checkElementNotExist('.coding-rules-detail-quality-profile-activate') + .checkElementExist('.coding-rules-detail-quality-profile-deactivate') + + .clickElement('.coding-rules-detail-quality-profile-deactivate') + .clickElement('[data-confirm="yes"]') + .checkElementNotExist('.coding-rule-activation .icon-severity-major') + .checkElementNotExist('.coding-rule-activation .icon-severity-major') + .checkElementExist('.coding-rules-detail-quality-profile-activate') + .checkElementNotExist('.coding-rules-detail-quality-profile-deactivate'); + }); }); }); |