Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Schatz <jacobschatz@Jacobs-MBP.fios-router.home>2015-12-22 00:35:03 +0300
committerJacob Schatz <jacobschatz@Jacobs-MBP.fios-router.home>2015-12-22 00:35:03 +0300
commit3e7e7ae0aceaa8a805093841b07b9b5d9f911cb1 (patch)
treeb78b586d7cb4b9ad0e185ec01a3e50bb44684d98 /spec/javascripts/issue_spec.js.coffee
parentfec7c99e2f2221f22680c140b7d9b1d959d8aeb0 (diff)
clarifies tests with methods like `toBeVisible()` etc.
Diffstat (limited to 'spec/javascripts/issue_spec.js.coffee')
-rw-r--r--spec/javascripts/issue_spec.js.coffee21
1 files changed, 9 insertions, 12 deletions
diff --git a/spec/javascripts/issue_spec.js.coffee b/spec/javascripts/issue_spec.js.coffee
index f8e60565b9a..f50640d1821 100644
--- a/spec/javascripts/issue_spec.js.coffee
+++ b/spec/javascripts/issue_spec.js.coffee
@@ -34,7 +34,7 @@ describe 'reopen/close issue', ->
# setup
$btnClose = $('a.btn-close')
$btnReopen = $('a.btn-reopen')
- expect($btnReopen.hasClass('hidden')).toBe(true)
+ expect($btnReopen.toBeHidden())
expect($btnClose.text()).toBe('Close')
expect(typeof $btnClose.prop('disabled')).toBe('undefined')
@@ -42,11 +42,10 @@ describe 'reopen/close issue', ->
$btnClose.trigger('click')
# verify
- expect($btnClose.hasClass('hidden')).toBe(true)
- expect($btnReopen.hasClass('hidden')).toBe(false)
- expect($btnClose.prop('disabled')).toBe(false)
- expect($('div.issue-box-open').hasClass('hidden')).toBe(true)
- expect($('div.issue-box-closed').hasClass('hidden')).toBe(false)
+ expect($btnClose.toBeHidden())
+ expect($btnReopen.toBeVisible())
+ expect($('div.issue-box-open').toBeVisible())
+ expect($('div.issue-box-closed').toBeHidden())
# teardown
it 'reopens an issue', ->
@@ -58,17 +57,15 @@ describe 'reopen/close issue', ->
# setup
$btnClose = $('a.btn-close')
$btnReopen = $('a.btn-reopen')
- expect(typeof $btnReopen.prop('disabled')).toBe('undefined')
expect($btnReopen.text()).toBe('Reopen')
# excerize
$btnReopen.trigger('click')
# verify
- expect($btnReopen.hasClass('hidden')).toBe(true)
- expect($btnClose.hasClass('hidden')).toBe(false)
- expect($btnReopen.prop('disabled')).toBe(false)
- expect($('div.issue-box-open').hasClass('hidden')).toBe(false)
- expect($('div.issue-box-closed').hasClass('hidden')).toBe(true)
+ expect($btnReopen.toBeHidden())
+ expect($btnClose.toBeVisible())
+ expect($('div.issue-box-open').toBeVisible())
+ expect($('div.issue-box-closed').toBeHidden())
# teardown \ No newline at end of file