summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWinnie Hellmann <winnie@gitlab.com>2019-01-28 12:41:22 +0100
committerWinnie Hellmann <winnie@gitlab.com>2019-01-28 14:21:52 +0100
commit8cb945b3a3a4900312144182bff0f6a6b8441939 (patch)
treefd4d2c4d7e7ce2c8bb853b4709096dc0a08748ce
parent436a43346729745b3aeba214b27de937c65f062e (diff)
downloadgitlab-ce-winh-fix-transient-gfm_autocomplete_spec.tar.gz
Split label dropdown test cases in gfm_autocomplete_spec.rbwinh-fix-transient-gfm_autocomplete_spec
-rw-r--r--spec/features/issues/gfm_autocomplete_spec.rb60
1 files changed, 40 insertions, 20 deletions
diff --git a/spec/features/issues/gfm_autocomplete_spec.rb b/spec/features/issues/gfm_autocomplete_spec.rb
index c22ad0d20ef..2772bea8210 100644
--- a/spec/features/issues/gfm_autocomplete_spec.rb
+++ b/spec/features/issues/gfm_autocomplete_spec.rb
@@ -278,8 +278,7 @@ describe 'GFM autocomplete', :js do
end
end
- # This context has jsut one example in each contexts in order to improve spec performance.
- context 'labels', :quarantine do
+ context 'labels' do
let!(:backend) { create(:label, project: project, title: 'backend') }
let!(:bug) { create(:label, project: project, title: 'bug') }
let!(:feature_proposal) { create(:label, project: project, title: 'feature proposal') }
@@ -300,24 +299,31 @@ describe 'GFM autocomplete', :js do
end
context 'when no labels are assigned' do
- it 'shows labels' do
+ it 'shows all labels for ~' do
note = find('#note-body')
-
- # It should show all the labels on "~".
type(note, '~')
wait_for_requests
expect_labels(shown: [backend, bug, feature_proposal])
+ end
- # It should show all the labels on "/label ~".
+ it 'shows all labels for /label ~' do
+ note = find('#note-body')
type(note, '/label ~')
+ wait_for_requests
expect_labels(shown: [backend, bug, feature_proposal])
+ end
- # It should show all the labels on "/relabel ~".
+ it 'shows all labels for /relabel ~' do
+ note = find('#note-body')
type(note, '/relabel ~')
+ wait_for_requests
expect_labels(shown: [backend, bug, feature_proposal])
+ end
- # It should show no labels on "/unlabel ~".
+ it 'shows no labels for /unlabel ~' do
+ note = find('#note-body')
type(note, '/unlabel ~')
+ wait_for_requests
expect_labels(not_shown: [backend, bug, feature_proposal])
end
end
@@ -327,24 +333,31 @@ describe 'GFM autocomplete', :js do
issue.labels << [backend]
end
- it 'shows labels' do
+ it 'shows all labels for ~' do
note = find('#note-body')
-
- # It should show all the labels on "~".
type(note, '~')
wait_for_requests
expect_labels(shown: [backend, bug, feature_proposal])
+ end
- # It should show only unset labels on "/label ~".
+ it 'shows only unset labels for /label ~' do
+ note = find('#note-body')
type(note, '/label ~')
+ wait_for_requests
expect_labels(shown: [bug, feature_proposal], not_shown: [backend])
+ end
- # It should show all the labels on "/relabel ~".
+ it 'shows all labels for /relabel ~' do
+ note = find('#note-body')
type(note, '/relabel ~')
+ wait_for_requests
expect_labels(shown: [backend, bug, feature_proposal])
+ end
- # It should show only set labels on "/unlabel ~".
+ it 'shows only set labels for /unlabel ~' do
+ note = find('#note-body')
type(note, '/unlabel ~')
+ wait_for_requests
expect_labels(shown: [backend], not_shown: [bug, feature_proposal])
end
end
@@ -354,24 +367,31 @@ describe 'GFM autocomplete', :js do
issue.labels << [backend, bug, feature_proposal]
end
- it 'shows labels' do
+ it 'shows all labels for ~' do
note = find('#note-body')
-
- # It should show all the labels on "~".
type(note, '~')
wait_for_requests
expect_labels(shown: [backend, bug, feature_proposal])
+ end
- # It should show no labels on "/label ~".
+ it 'shows no labels for /label ~' do
+ note = find('#note-body')
type(note, '/label ~')
+ wait_for_requests
expect_labels(not_shown: [backend, bug, feature_proposal])
+ end
- # It should show all the labels on "/relabel ~".
+ it 'shows all labels for /relabel ~' do
+ note = find('#note-body')
type(note, '/relabel ~')
+ wait_for_requests
expect_labels(shown: [backend, bug, feature_proposal])
+ end
- # It should show all the labels on "/unlabel ~".
+ it 'shows all labels for /unlabel ~' do
+ note = find('#note-body')
type(note, '/unlabel ~')
+ wait_for_requests
expect_labels(shown: [backend, bug, feature_proposal])
end
end