diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-20 15:10:03 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-20 15:10:03 +0300 |
commit | 43b4b3e2d2ddebc0a89b94a8251c162ec5719780 (patch) | |
tree | 8a21146370cfd1b24b25cfcacef53e889746f5aa /spec | |
parent | 196ada0844fff7642463fbd08a44609a1e1fa713 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/dashboard/groups_list_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/explore/groups_list_spec.rb | 8 | ||||
-rw-r--r-- | spec/features/issues/filtered_search/visual_tokens_spec.rb | 13 | ||||
-rw-r--r-- | spec/features/projects/snippets/user_updates_snippet_spec.rb | 31 | ||||
-rw-r--r-- | spec/features/snippets/user_edits_snippet_spec.rb | 35 | ||||
-rw-r--r-- | spec/lib/gitlab/danger/helper_spec.rb | 1 | ||||
-rw-r--r-- | spec/lib/gitlab/import_export/safe_model_attributes.yml | 2 |
7 files changed, 79 insertions, 13 deletions
diff --git a/spec/features/dashboard/groups_list_spec.rb b/spec/features/dashboard/groups_list_spec.rb index 76785534ec7..5b336f994f7 100644 --- a/spec/features/dashboard/groups_list_spec.rb +++ b/spec/features/dashboard/groups_list_spec.rb @@ -77,7 +77,7 @@ describe 'Dashboard Groups page', :js do expect(page).to have_content(group.name) expect(page).to have_content(nested_group.parent.name) expect(page).not_to have_content(another_group.name) - expect(page.all('.js-groups-list-holder .content-list li').length).to eq 2 + expect(page.all('.js-groups-list-holder .groups-list li').length).to eq 2 end end diff --git a/spec/features/explore/groups_list_spec.rb b/spec/features/explore/groups_list_spec.rb index 9686eee18fc..c14144ab3d5 100644 --- a/spec/features/explore/groups_list_spec.rb +++ b/spec/features/explore/groups_list_spec.rb @@ -47,26 +47,26 @@ describe 'Explore Groups page', :js do expect(page).to have_content(group.full_name) expect(page).to have_content(public_group.full_name) expect(page).not_to have_content(private_group.full_name) - expect(page.all('.js-groups-list-holder .content-list li').length).to eq 2 + expect(page.all('.js-groups-list-holder .groups-list li').length).to eq 2 end it 'shows non-archived projects count' do # Initially project is not archived - expect(find('.js-groups-list-holder .content-list li:first-child .stats .number-projects')).to have_text("1") + expect(find('.js-groups-list-holder .groups-list li:first-child .stats .number-projects')).to have_text("1") # Archive project ::Projects::UpdateService.new(empty_project, user, archived: true).execute visit explore_groups_path # Check project count - expect(find('.js-groups-list-holder .content-list li:first-child .stats .number-projects')).to have_text("0") + expect(find('.js-groups-list-holder .groups-list li:first-child .stats .number-projects')).to have_text("0") # Unarchive project ::Projects::UpdateService.new(empty_project, user, archived: false).execute visit explore_groups_path # Check project count - expect(find('.js-groups-list-holder .content-list li:first-child .stats .number-projects')).to have_text("1") + expect(find('.js-groups-list-holder .groups-list li:first-child .stats .number-projects')).to have_text("1") end describe 'landing component' do diff --git a/spec/features/issues/filtered_search/visual_tokens_spec.rb b/spec/features/issues/filtered_search/visual_tokens_spec.rb index 29111bff344..3c50cb4c997 100644 --- a/spec/features/issues/filtered_search/visual_tokens_spec.rb +++ b/spec/features/issues/filtered_search/visual_tokens_spec.rb @@ -162,4 +162,17 @@ describe 'Visual tokens', :js do ]) end end + + it 'does retain hint token when mix of typing and clicks are performed' do + input_filtered_search('label:', extra_space: false, submit: false) + + expect(page).to have_css('#js-dropdown-operator', visible: true) + + find('#js-dropdown-operator li[data-value="="]').click + + token = page.all('.tokens-container .js-visual-token')[0] + + expect(token.find('.name').text).to eq('Label') + expect(token.find('.operator').text).to eq('=') + end end diff --git a/spec/features/projects/snippets/user_updates_snippet_spec.rb b/spec/features/projects/snippets/user_updates_snippet_spec.rb index f9628b37089..bad3fde8a4a 100644 --- a/spec/features/projects/snippets/user_updates_snippet_spec.rb +++ b/spec/features/projects/snippets/user_updates_snippet_spec.rb @@ -2,13 +2,17 @@ require 'spec_helper' -describe 'Projects > Snippets > User updates a snippet' do +describe 'Projects > Snippets > User updates a snippet', :js do let_it_be(:user) { create(:user) } let_it_be(:project) { create(:project, namespace: user.namespace) } - let!(:snippet) { create(:project_snippet, project: project, author: user) } + let_it_be(:snippet, reload: true) { create(:project_snippet, :repository, project: project, author: user) } + + let(:version_snippet_enabled) { true } before do stub_feature_flags(snippets_vue: false) + stub_feature_flags(version_snippets: version_snippet_enabled) + project.add_maintainer(user) sign_in(user) @@ -17,6 +21,29 @@ describe 'Projects > Snippets > User updates a snippet' do page.within('.detail-page-header') do first(:link, 'Edit').click end + wait_for_all_requests + end + + it 'displays the snippet blob path and content' do + blob = snippet.blobs.first + + aggregate_failures do + expect(page.find_field('project_snippet_file_name').value).to eq blob.path + expect(page.find('.file-content')).to have_content(blob.data.strip) + expect(page.find('.snippet-file-content', visible: false).value).to eq blob.data + end + end + + context 'when feature flag :version_snippets is disabled' do + let(:version_snippet_enabled) { false } + + it 'displays the snippet file_name and content' do + aggregate_failures do + expect(page.find_field('project_snippet_file_name').value).to eq snippet.file_name + expect(page.find('.file-content')).to have_content(snippet.content) + expect(page.find('.snippet-file-content', visible: false).value).to eq snippet.content + end + end end it 'updates a snippet' do diff --git a/spec/features/snippets/user_edits_snippet_spec.rb b/spec/features/snippets/user_edits_snippet_spec.rb index b003e50aab7..0bbb92b1f3f 100644 --- a/spec/features/snippets/user_edits_snippet_spec.rb +++ b/spec/features/snippets/user_edits_snippet_spec.rb @@ -5,18 +5,43 @@ require 'spec_helper' describe 'User edits snippet', :js do include DropzoneHelper - let(:file_name) { 'test.rb' } - let(:content) { 'puts "test"' } - + let_it_be(:file_name) { 'test.rb' } + let_it_be(:content) { 'puts "test"' } let_it_be(:user) { create(:user) } - let(:snippet) { create(:personal_snippet, :public, file_name: file_name, content: content, author: user) } + let_it_be(:snippet, reload: true) { create(:personal_snippet, :repository, :public, file_name: file_name, content: content, author: user) } + + let(:version_snippet_enabled) { true } before do stub_feature_flags(snippets_vue: false) + stub_feature_flags(version_snippets: version_snippet_enabled) + sign_in(user) visit edit_snippet_path(snippet) - wait_for_requests + wait_for_all_requests + end + + it 'displays the snippet blob path and content' do + blob = snippet.blobs.first + + aggregate_failures do + expect(page.find_field('personal_snippet_file_name').value).to eq blob.path + expect(page.find('.file-content')).to have_content(blob.data.strip) + expect(page.find('.snippet-file-content', visible: false).value).to eq blob.data + end + end + + context 'when feature flag :version_snippets is disabled' do + let(:version_snippet_enabled) { false } + + it 'displays the snippet file_name and content' do + aggregate_failures do + expect(page.find_field('personal_snippet_file_name').value).to eq file_name + expect(page.find('.file-content')).to have_content(content) + expect(page.find('.snippet-file-content', visible: false).value).to eq content + end + end end it 'updates the snippet' do diff --git a/spec/lib/gitlab/danger/helper_spec.rb b/spec/lib/gitlab/danger/helper_spec.rb index dd183281977..1c9df641655 100644 --- a/spec/lib/gitlab/danger/helper_spec.rb +++ b/spec/lib/gitlab/danger/helper_spec.rb @@ -206,7 +206,6 @@ describe Gitlab::Danger::Helper do 'Gemfile' | :backend 'Gemfile.lock' | :backend - 'Procfile' | :backend 'Rakefile' | :backend 'FOO_VERSION' | :backend diff --git a/spec/lib/gitlab/import_export/safe_model_attributes.yml b/spec/lib/gitlab/import_export/safe_model_attributes.yml index 4c9caaa181a..5b0444c394e 100644 --- a/spec/lib/gitlab/import_export/safe_model_attributes.yml +++ b/spec/lib/gitlab/import_export/safe_model_attributes.yml @@ -31,6 +31,7 @@ Issue: - last_edited_by_id - discussion_locked - health_status +- external_key Event: - id - target_type @@ -843,6 +844,7 @@ Epic: - start_date_sourcing_epic_id - due_date_sourcing_epic_id - health_status + - external_key EpicIssue: - id - relative_position |