Sha256: 94cc9a231300f68a4945c120e1e775e5069ebb133a9ab7eed1181eccf060c14c
Contents?: true
Size: 1.65 KB
Versions: 3
Compression:
Stored size: 1.65 KB
Contents
require '/assets/mercury/mercury.js' describe "Mercury.Select", -> template 'mercury/select.html' beforeEach -> $.fx.off = true afterEach -> @select = null delete(@select) describe "#build", -> it "builds an element", -> @select = new Mercury.Select('/evergreen/responses/blank.html', 'foo', {appendTo: '#test', for: $('#button')}) html = $('<div>').html(@select.element).html() expect(html).toContain('class="mercury-select mercury-foo-select loading"') expect(html).toContain('style="display:none"') it "appends to any element", -> @select = new Mercury.Select('/evergreen/responses/blank.html', 'foo', {appendTo: '#select_container', for: $('#button')}) expect($('#select_container .mercury-select').length).toEqual(1) describe "observed events", -> beforeEach -> @select = new Mercury.Select('/evergreen/responses/blank.html', 'foo', {appendTo: '#test', for: $('#button')}) it "hides", -> @select.element.css({display: 'block'}) Mercury.trigger('hide:dialogs') expect(@select.element.css('display')).toEqual('none') it "doesn't hide if it's the same dialog", -> @select.element.css({display: 'block'}) Mercury.trigger('hide:dialogs', @select) expect(@select.element.css('display')).toEqual('block') describe "#position", -> beforeEach -> @select = new Mercury.Select('/evergreen/responses/blank.html', 'foo', {appendTo: '#test', for: $('#button')}) it "positions based on it's button", -> @select.element.css({display: 'block'}) @select.position(true) expect(@select.element.offset()).toEqual({top: 20, left: 42})
Version data entries
3 entries across 3 versions & 1 rubygems