Skip to content

Instantly share code, notes, and snippets.

@dubilla
Last active August 29, 2015 14:01
Show Gist options
  • Save dubilla/7751bd858b242bc8a124 to your computer and use it in GitHub Desktop.
Save dubilla/7751bd858b242bc8a124 to your computer and use it in GitHub Desktop.
Directive Test
describe 'Deal Term Display', ->
HTML = '<div deal-terms></div>'
scope = elem = DealTerm = null
beforeEach ->
inject ($compile, $rootScope, _DealTerm_) ->
DealTerm = _DealTerm_
scope = $rootScope.$new()
scope.log = deal_terms: []
scope.showthis = true
elem = angular.element(HTML)
$compile(elem)(scope)
scope.$apply()
describe.only 'showthis', ->
it 'should show this', ->
expect(elem.find('.ubilla')).to.have.length 1
.deal-terms{'ng-class'=>"{expanded: limit > 1}"}
.ubilla{'ng-if' => 'showthis'}
%a.deal-terms-expand{href:'', 'ng-click'=>"toggleExpansion()", 'ng-show'=>"log.deal_terms.length > 1"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment