Sha256: a7add386183b3aafda7a97a51b0f5ec5b5c681b621ae2ec18bf8271ca9a11e7d
Contents?: true
Size: 1.37 KB
Versions: 11
Compression:
Stored size: 1.37 KB
Contents
// ========================================================================== // Project: SproutCore - JavaScript Application Framework // Copyright: ©2006-2009 Sprout Systems, Inc. and contributors. // Portions ©2008-2009 Apple, Inc. All rights reserved. // License: Licened under MIT license (see license.js) // ========================================================================== /*global module test equals context ok */ var context = null; module("SC.RenderContext#element", { setup: function() { context = SC.RenderContext() ; }, teardown: function() { context = null; } }); test("converts context to a DOM element and returns root element if there is one", function() { context.id('foo'); var elem = context.element(); ok(elem, 'elem not null'); equals(elem.tagName.toString().toLowerCase(), 'div', 'is div'); equals(elem.id.toString(), 'foo', 'is id=foo'); elem = null ; }); test("returns null if context does not generate valid element", function() { context = SC.RenderContext(null); var elem = context.element(); equals(elem, null, 'should be null'); elem = null; }); test("returns first element if context renders multiple element", function() { context.tag('div').tag('span'); var elem = context.element(); ok(elem, 'elem not null'); equals(elem.tagName.toString().toLowerCase(), 'div', 'is div'); elem = null; });
Version data entries
11 entries across 11 versions & 1 rubygems