fixes tests to work with jasmine/jquery

This commit is contained in:
Jacob Schatz 2015-12-23 16:56:36 -05:00
parent 3ea3d9ef28
commit 7e43fa6709
2 changed files with 16 additions and 13 deletions

View file

@ -1,7 +1,10 @@
.issue-box.issue-box-open Open
.issue-box.issue-box-closed.hidden Closed
%a.btn-close{"data-url" => "http://gitlab/issues/6/close"} Close
%a.btn-reopen.hidden{"data-url" => "http://gitlab/issues/6/reopen"} Reopen
:css
.hidden { display: none !important; }
.status-box.status-box-open Open
.status-box.status-box-closed.hidden Closed
%a.btn-close{"href" => "http://gitlab/issues/6/close"} Close
%a.btn-reopen.hidden{"href" => "http://gitlab/issues/6/reopen"} Reopen
.detail-page-description
.description.js-task-list-container

View file

@ -33,16 +33,16 @@ describe 'reopen/close issue', ->
$btnClose = $('a.btn-close')
$btnReopen = $('a.btn-reopen')
expect($btnReopen.toBeHidden())
expect($btnReopen).toBeHidden()
expect($btnClose.text()).toBe('Close')
expect(typeof $btnClose.prop('disabled')).toBe('undefined')
$btnClose.trigger('click')
expect($btnClose.toBeHidden())
expect($btnReopen.toBeVisible())
expect($('div.issue-box-open').toBeVisible())
expect($('div.issue-box-closed').toBeHidden())
expect($btnReopen).toBeVisible()
expect($btnClose).toBeHidden()
expect($('div.status-box-closed')).toBeVisible()
expect($('div.status-box-open')).toBeHidden()
it 'reopens an issue', ->
$.ajax = (obj) ->
@ -56,7 +56,7 @@ describe 'reopen/close issue', ->
$btnReopen.trigger('click')
expect($btnReopen.toBeHidden())
expect($btnClose.toBeVisible())
expect($('div.issue-box-open').toBeVisible())
expect($('div.issue-box-closed').toBeHidden())
expect($btnReopen).toBeHidden()
expect($btnClose).toBeVisible()
expect($('div.status-box-open')).toBeVisible()
expect($('div.status-box-closed')).toBeHidden()