[Pkg-javascript-commits] [backbone] 07/173: Test for conflicting className/id and attributes

Jonas Smedegaard dr at jones.dk
Wed Aug 31 07:43:56 UTC 2016


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository backbone.

commit afd2ce8b5950ada27b4a3784b989c4c2973b221a
Author: Garrett Maring <garrett.maring at gmail.com>
Date:   Tue Sep 15 13:58:36 2015 -0700

    Test for conflicting className/id and attributes
---
 test/view.js | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/test/view.js b/test/view.js
index 51e6c6e..ca73c27 100644
--- a/test/view.js
+++ b/test/view.js
@@ -270,6 +270,23 @@
     strictEqual(new View().el.className, 'dynamic');
   });
 
+  test("should default to className/id properties", 4, function() {
+    var View = Backbone.View.extend({
+      className: 'backboneClass',
+      id: 'backboneId',
+      attributes: {
+        'class': 'attributeClass',
+        'id': 'attributeId'
+      }
+    });
+
+    var view = new View;
+    strictEqual(view.el.className, 'backboneClass');
+    strictEqual(view.el.id, 'backboneId');
+    strictEqual(view.$el.attr('class'), 'backboneClass');
+    strictEqual(view.$el.attr('id'), 'backboneId');
+  });
+
   test("multiple views per element", 3, function() {
     var count = 0;
     var $el = $('<p></p>');

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/backbone.git



More information about the Pkg-javascript-commits mailing list