Skip to content
Snippets Groups Projects
Commit 7e43fa67 authored by Jacob Schatz's avatar Jacob Schatz
Browse files

fixes tests to work with jasmine/jquery

parent 3ea3d9ef
No related branches found
No related tags found
1 merge request!2164open and close issue via ajax request. With tests
Pipeline #
.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
Loading
Loading
Loading
Loading
@@ -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) ->
Loading
Loading
@@ -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())
\ No newline at end of file
expect($btnReopen).toBeHidden()
expect($btnClose).toBeVisible()
expect($('div.status-box-open')).toBeVisible()
expect($('div.status-box-closed')).toBeHidden()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment