4f2b44f8492a6eedb8367b6eab417235b9ef4e18Eric FerraiuoloYUI.add('overlay-test', function (Y) {
4f2b44f8492a6eedb8367b6eab417235b9ef4e18Eric Ferraiuolo
4f2b44f8492a6eedb8367b6eab417235b9ef4e18Eric Ferraiuolovar Assert = Y.Assert,
4f2b44f8492a6eedb8367b6eab417235b9ef4e18Eric Ferraiuolo ArrayAssert = Y.ArrayAssert,
4f2b44f8492a6eedb8367b6eab417235b9ef4e18Eric Ferraiuolo
4f2b44f8492a6eedb8367b6eab417235b9ef4e18Eric Ferraiuolo suite;
4f2b44f8492a6eedb8367b6eab417235b9ef4e18Eric Ferraiuolo
4f2b44f8492a6eedb8367b6eab417235b9ef4e18Eric Ferraiuolo// -- Suite --------------------------------------------------------------------
4f2b44f8492a6eedb8367b6eab417235b9ef4e18Eric Ferraiuolosuite = new Y.Test.Suite('Overlay');
4f2b44f8492a6eedb8367b6eab417235b9ef4e18Eric Ferraiuolo
4f2b44f8492a6eedb8367b6eab417235b9ef4e18Eric Ferraiuolo// -- Lifecycle ----------------------------------------------------------------
4f2b44f8492a6eedb8367b6eab417235b9ef4e18Eric Ferraiuolosuite.add(new Y.Test.Case({
4f2b44f8492a6eedb8367b6eab417235b9ef4e18Eric Ferraiuolo name: 'Lifecycle',
4f2b44f8492a6eedb8367b6eab417235b9ef4e18Eric Ferraiuolo
4f2b44f8492a6eedb8367b6eab417235b9ef4e18Eric Ferraiuolo tearDown: function () {
4f2b44f8492a6eedb8367b6eab417235b9ef4e18Eric Ferraiuolo this.overlay && this.overlay.destroy();
4f2b44f8492a6eedb8367b6eab417235b9ef4e18Eric Ferraiuolo delete this.overlay;
4f2b44f8492a6eedb8367b6eab417235b9ef4e18Eric Ferraiuolo Y.one('#test').empty();
4f2b44f8492a6eedb8367b6eab417235b9ef4e18Eric Ferraiuolo },
4f2b44f8492a6eedb8367b6eab417235b9ef4e18Eric Ferraiuolo
4f2b44f8492a6eedb8367b6eab417235b9ef4e18Eric Ferraiuolo 'Y.Overlay() should create a new overlay widget': function () {
4f2b44f8492a6eedb8367b6eab417235b9ef4e18Eric Ferraiuolo this.overlay = new Y.Overlay();
4f2b44f8492a6eedb8367b6eab417235b9ef4e18Eric Ferraiuolo this.overlay.render('#test');
4f2b44f8492a6eedb8367b6eab417235b9ef4e18Eric Ferraiuolo
4f2b44f8492a6eedb8367b6eab417235b9ef4e18Eric Ferraiuolo Assert.isInstanceOf(Y.Overlay, this.overlay, 'Not an instance of a `Y.Overlay`.');
4f2b44f8492a6eedb8367b6eab417235b9ef4e18Eric Ferraiuolo Assert.isTrue(Y.one('#test').contains(this.overlay.get('boundingBox')), 'Overlay was not rendered into "#test".');
4f2b44f8492a6eedb8367b6eab417235b9ef4e18Eric Ferraiuolo }
4f2b44f8492a6eedb8367b6eab417235b9ef4e18Eric Ferraiuolo}));
4f2b44f8492a6eedb8367b6eab417235b9ef4e18Eric Ferraiuolo
4f2b44f8492a6eedb8367b6eab417235b9ef4e18Eric FerraiuoloY.Test.Runner.add(suite);
4f2b44f8492a6eedb8367b6eab417235b9ef4e18Eric Ferraiuolo
4f2b44f8492a6eedb8367b6eab417235b9ef4e18Eric Ferraiuolo}, '@VERSION@', {
4f2b44f8492a6eedb8367b6eab417235b9ef4e18Eric Ferraiuolo requires: ['overlay', 'test']
4f2b44f8492a6eedb8367b6eab417235b9ef4e18Eric Ferraiuolo});