Skip to content

Instantly share code, notes, and snippets.

@aTei
Last active December 18, 2015 23:59
Show Gist options
  • Select an option

  • Save aTei/5865525 to your computer and use it in GitHub Desktop.

Select an option

Save aTei/5865525 to your computer and use it in GitHub Desktop.
BDD test secodary alts
describe 'Secondary alts', ->
loadFixtures('html/vid_alts')
$('.show-secondary').show_secondary()
hidden_alts = null
secondary_button = null
beforeEach ->
hidden_alts = $('.vid_view_alt_secondary')
secondary_button = $('.show-secondary')
it 'when loaded should be hidden', ->
expect(hidden_alts).toBeHidden()
it 'when button clicked, should be visible', ->
secondary_button.trigger('click')
expect(hidden_alts).not.toHaveClass('vid_view_alt_secondary')
expect(hidden_alts).not.toBeHidden()
it "when button clicked, button should be removed", ->
secondary_button.trigger('click')
expect(secondary_button.length).toBe(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment