Sha256: 55e45726c476714928a1460999aeec25c6c9561eabc923d253de7ed64225cbb7
Contents?: true
Size: 1.37 KB
Versions: 11
Compression:
Stored size: 1.37 KB
Contents
// ========================================================================== // Project: SproutCore - JavaScript Application Framework // Copyright: ©2006-2010 Sprout Systems, Inc. and contributors. // Portions ©2008-2010 Apple Inc. All rights reserved. // License: Licensed 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