Sha256: d97f97f6c4fb56359c822a2ea6c8cc735d92ea5e5b6510524539664bf9adca4f

Contents?: true

Size: 1.43 KB

Versions: 1

Compression:

Stored size: 1.43 KB

Contents

describe "Menu", ->

  it "should be a unique instance of the menu view accessible via the OverlayMe namespace", ->
    expect(OverlayMe.menu).toBeDefined()

  it "should have been appended to the DOM", ->
    expect($o("##{OverlayMe.menu.el.id}").length).toEqual 1

  it "should be Draggable", ->
    expect(OverlayMe.menu.engageMove).toBeDefined()
    expect(OverlayMe.menu.toggleMove).toBeDefined()

  it "should append MenuItems to its list", ->
    expect($o('ul #test-append-li', OverlayMe.menu.el).length).toEqual 0
    test_li = $o('<li id="test-append-li" class="menu-item">Just a test :)</li>')[0] # todo: mock a better test item
    OverlayMe.menu.append(test_li)
    expect($o('ul #test-append-li', OverlayMe.menu.el).length).toEqual 1
    $o('ul #test-append-li', OverlayMe.menu.el).remove()

  it "should be collapsable/uncollapsable", ->
    collapsed = OverlayMe.menu.collapsed()
    OverlayMe.menu.toggleCollapse()
    expect(OverlayMe.menu.collapsed()).toEqual !collapsed
    expect($o(OverlayMe.menu.el).hasClass('collapsed')).toEqual !collapsed

  it "should have been added at the root of the page as #overlay_me_dev_tools_menu", ->
    expect($o('body > #overlay_me_menu').length).toEqual 1

  it "should have moved any content from the original page root into a div #overlay_me_page_container", ->
   expect($o('#overlay_me_page_container #original_root_level_div').length).toEqual 1



  xit "should change of location when dragged", ->


Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
overlay_me-0.13.4 spec/javascripts/coffeescripts/menu.spec.js.coffee