Sha256: ed919c97633290c8b742a018a4712557deef85ce9afa595f0781ac865626a038
Contents?: true
Size: 1.43 KB
Versions: 11
Compression:
Stored size: 1.43 KB
Contents
// ========================================================================== // Project: SproutCore - JavaScript Application Framework // Copyright: ©2006-2009 Apple, Inc. and contributors. // License: Licened under MIT license (see license.js) // ========================================================================== /*global module test equals context ok same */ module("SC.View#init"); test("registers view in the global views hash using layerId for event targeted", function() { var v = SC.View.create(); equals(SC.View.views[v.get('layerId')], v, 'registers view'); }); test("adds displayDidChange observer on all display properties", function() { var didChange = NO ; var v = SC.View.create({ // override just to make sure the registration works... displayDidChange: function() { didChange = YES ; }, displayProperties: 'foo bar'.w(), foo: 'foo', bar: 'bar' }); v.set('foo', 'baz'); ok(didChange, 'didChange on set(foo)'); didChange = NO ; v.set('bar', 'baz'); ok(didChange, 'didChange on set(bar)'); }); test("invokes createChildViews()", function() { var didInvoke = NO ; var v = SC.View.create({ // override just for test createChildViews: function() { didInvoke = YES; } }); ok(didInvoke, 'did invoke createChildViews()'); }); test("does NOT create layer", function() { var v = SC.View.create(); equals(v.get('layer'), null, 'did not create layer'); });
Version data entries
11 entries across 11 versions & 1 rubygems