]> source.dussan.org Git - sonarqube.git/commitdiff
Revert "Remove legacy tests"
authorSimon Brandhof <simon.brandhof@gmail.com>
Fri, 14 Feb 2014 17:36:09 +0000 (18:36 +0100)
committerSimon Brandhof <simon.brandhof@gmail.com>
Fri, 14 Feb 2014 17:36:09 +0000 (18:36 +0100)
This reverts commit 62348c196b097f59f03c33fecdf073a16c76705e.

sonar-server/karma.conf.js
sonar-server/src/main/webapp/javascripts/tests/measures.js [new file with mode: 0644]

index 84533718a3b9d9436b131829d930f0186e89e70d..9619bdfee07b4c50d8987690a8a28c3f49f58367 100644 (file)
@@ -23,7 +23,17 @@ module.exports = function(config) {
 
     // list of files / patterns to load in the browser
     files: [
-        // nothing here yet
+        // dependencies
+        'third-party/jquery.min.js',
+        'third-party/underscore.js',
+        'third-party/backbone.js',
+        'third-party/backbone.marionette.js',
+
+        // app
+        'navigator/filters/base-filters.js',
+
+        // tests
+        'tests/measures.js'
     ],
 
 
diff --git a/sonar-server/src/main/webapp/javascripts/tests/measures.js b/sonar-server/src/main/webapp/javascripts/tests/measures.js
new file mode 100644 (file)
index 0000000..b8b2f23
--- /dev/null
@@ -0,0 +1,23 @@
+/* jshint undef:false */
+
+test("filter defaults", function() {
+  var filter = new window.SS.Filter();
+  strictEqual(true, filter.get('multiple'), "multiple doesn't equal true");
+  equal(false, filter.get('placeholder'), "placeholder doesn't equal ''");
+});
+
+test("is model.view correctly set", function() {
+  var filter = new window.SS.Filter(),
+      filterView = new window.SS.BaseFilterView({
+        model: filter
+      });
+  strictEqual(filterView, filter.view, "model.view doesn't model's view");
+});
+
+test("is details view set to default", function() {
+  var filter = new window.SS.Filter(),
+      filterView = new window.SS.BaseFilterView({
+        model: filter
+      });
+  ok(filterView.detailsView instanceof window.SS.DetailsFilterView, "");
+});