Sha256: 257949eda709e2a0be9050fb534bcaa247160ffcc9c64abc783e872f2ec60be8

Contents?: true

Size: 1.87 KB

Versions: 20

Compression:

Stored size: 1.87 KB

Contents

describe 'up.tooltip', ->
  
  describe 'Javascript functions', ->
    
    describe 'up.tooltip.attach', ->
      
      it 'opens a tooltop above the center of the given element', ->
        $link = affix('span').text('button label')
        $link.css(
          position: 'absolute'
          left: '200px'
          top: '200px'
          width: '50px'
          height: '50px'
        )
        up.tooltip.attach($link, html: 'tooltip text')
        $tooltip = $('.up-tooltip')
        expect($tooltip).toBeInDOM()
        expect($tooltip).toHaveText('tooltip text')
        tooltipBox = up.util.measure($tooltip, relative: true)
        linkBox = up.util.measure($link, relative: true)
        expect(tooltipBox.top).toBeAround(linkBox.top - tooltipBox.height, 15)
        expect(tooltipBox.left).toBeAround(linkBox.left + 0.5 * (linkBox.width - tooltipBox.width), 15)
        
      it 'allows HTML for the tooltip text when contents are given as .html option', ->
        $link = affix('span')
        up.tooltip.attach($link, html: '<b>text</b>')
        $tooltip = $('.up-tooltip')
        expect($tooltip.html()).toEqual('<b>text</b>')

      it 'escapes HTML for the tooltip text when contents given as .html option', ->
        $link = affix('span')
        up.tooltip.attach($link, text: '<b>text</b>')
        $tooltip = $('.up-tooltip')
        expect($tooltip.html()).toEqual('&lt;b&gt;text&lt;/b&gt;')

      it 'closes an existing tooltip'
      
      describe 'with position option', ->
        
        it 'anchors the tooltip at a different edge of the element'
      
    describe 'up.tooltip.close', ->

      it 'should have tests'
  
  describe 'unobtrusive behavior', ->
    
    describe '[up-tooltip]', ->

      it 'should have tests'

    describe '[up-tooltip-html]', ->

      it 'should have tests'

    describe 'body', ->
      
      it 'closes a tooltip when clicked'
      

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
unpoly-rails-0.22.1 spec_app/spec/javascripts/up/tooltip_spec.js.coffee
unpoly-rails-0.22.0 spec_app/spec/javascripts/up/tooltip_spec.js.coffee
unpoly-rails-0.21.0 spec_app/spec/javascripts/up/tooltip_spec.js.coffee
unpoly-rails-0.20.0 spec_app/spec/javascripts/up/tooltip_spec.js.coffee
upjs-rails-0.19.0 spec_app/spec/javascripts/up/tooltip_spec.js.coffee
upjs-rails-0.18.1 spec_app/spec/javascripts/up/tooltip_spec.js.coffee
upjs-rails-0.18.0 spec_app/spec/javascripts/up/tooltip_spec.js.coffee
upjs-rails-0.17.0 spec_app/spec/javascripts/up/tooltip_spec.js.coffee
upjs-rails-0.16.0 spec_app/spec/javascripts/up/tooltip_spec.js.coffee
upjs-rails-0.15.1 spec_app/spec/javascripts/up/tooltip_spec.js.coffee
upjs-rails-0.15.0 spec_app/spec/javascripts/up/tooltip_spec.js.coffee
upjs-rails-0.14.1 spec_app/spec/javascripts/up/tooltip_spec.js.coffee
upjs-rails-0.14.0 spec_app/spec/javascripts/up/tooltip_spec.js.coffee
upjs-rails-0.13.0 spec_app/spec/javascripts/up/tooltip_spec.js.coffee
upjs-rails-0.12.5 spec_app/spec/javascripts/up/tooltip_spec.js.coffee
upjs-rails-0.12.4 spec_app/spec/javascripts/up/tooltip_spec.js.coffee
upjs-rails-0.12.3 spec_app/spec/javascripts/up/tooltip_spec.js.coffee
upjs-rails-0.12.2 spec_app/spec/javascripts/up/tooltip_spec.js.coffee
upjs-rails-0.12.1 spec_app/spec/javascripts/up/tooltip_spec.js.coffee
upjs-rails-0.12.0 spec_app/spec/javascripts/up/tooltip_spec.js.coffee