diff options
Diffstat (limited to 'spec')
9 files changed, 60 insertions, 60 deletions
diff --git a/spec/frontend/sidebar/components/assignees/assignee_avatar_link_spec.js b/spec/frontend/sidebar/components/assignees/assignee_avatar_link_spec.js index 452d4cd07cc..d0d1af56872 100644 --- a/spec/frontend/sidebar/components/assignees/assignee_avatar_link_spec.js +++ b/spec/frontend/sidebar/components/assignees/assignee_avatar_link_spec.js @@ -24,6 +24,7 @@ describe('AssigneeAvatarLink component', () => { }; wrapper = shallowMount(AssigneeAvatarLink, { + attachToDocument: true, propsData, sync: false, }); diff --git a/spec/frontend/sidebar/components/assignees/collapsed_assignee_list_spec.js b/spec/frontend/sidebar/components/assignees/collapsed_assignee_list_spec.js index ff0c8d181b5..c88ae196875 100644 --- a/spec/frontend/sidebar/components/assignees/collapsed_assignee_list_spec.js +++ b/spec/frontend/sidebar/components/assignees/collapsed_assignee_list_spec.js @@ -16,6 +16,7 @@ describe('CollapsedAssigneeList component', () => { }; wrapper = shallowMount(CollapsedAssigneeList, { + attachToDocument: true, propsData, sync: false, }); diff --git a/spec/frontend/sidebar/components/assignees/uncollapsed_assignee_list_spec.js b/spec/frontend/sidebar/components/assignees/uncollapsed_assignee_list_spec.js index 6398351834c..1de21f30d21 100644 --- a/spec/frontend/sidebar/components/assignees/uncollapsed_assignee_list_spec.js +++ b/spec/frontend/sidebar/components/assignees/uncollapsed_assignee_list_spec.js @@ -18,6 +18,7 @@ describe('UncollapsedAssigneeList component', () => { }; wrapper = mount(UncollapsedAssigneeList, { + attachToDocument: true, sync: false, propsData, }); diff --git a/spec/graphql/types/extended_issue_type_spec.rb b/spec/graphql/types/extended_issue_type_spec.rb deleted file mode 100644 index 72ce53ae1be..00000000000 --- a/spec/graphql/types/extended_issue_type_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -describe GitlabSchema.types['ExtendedIssue'] do - it { expect(described_class).to expose_permissions_using(Types::PermissionTypes::Issue) } - - it { expect(described_class.graphql_name).to eq('ExtendedIssue') } - - it { expect(described_class).to require_graphql_authorizations(:read_issue) } - - it { expect(described_class.interfaces).to include(Types::Notes::NoteableType.to_graphql) } - - it 'has specific fields' do - fields = Types::IssueType.fields.keys + [:subscribed] - - fields.each do |field_name| - expect(described_class).to have_graphql_field(field_name) - end - end -end diff --git a/spec/graphql/types/issue_type_spec.rb b/spec/graphql/types/issue_type_spec.rb index 8aa2385ddaa..daa2224ef20 100644 --- a/spec/graphql/types/issue_type_spec.rb +++ b/spec/graphql/types/issue_type_spec.rb @@ -14,7 +14,7 @@ describe GitlabSchema.types['Issue'] do it 'has specific fields' do fields = %i[iid title description state reference author assignees participants labels milestone due_date confidential discussion_locked upvotes downvotes user_notes_count web_path web_url relative_position - time_estimate total_time_spent closed_at created_at updated_at task_completion_status] + subscribed time_estimate total_time_spent closed_at created_at updated_at task_completion_status] fields.each do |field_name| expect(described_class).to have_graphql_field(field_name) diff --git a/spec/graphql/types/project_type_spec.rb b/spec/graphql/types/project_type_spec.rb index f837fb9f77f..19a433f090e 100644 --- a/spec/graphql/types/project_type_spec.rb +++ b/spec/graphql/types/project_type_spec.rb @@ -33,7 +33,7 @@ describe GitlabSchema.types['Project'] do subject { described_class.fields['issue'] } it 'returns issue' do - is_expected.to have_graphql_type(Types::ExtendedIssueType) + is_expected.to have_graphql_type(Types::IssueType) is_expected.to have_graphql_resolver(Resolvers::IssuesResolver.single) end end diff --git a/spec/javascripts/dropzone_input_spec.js b/spec/javascripts/dropzone_input_spec.js index ef899612b08..125dcdb3763 100644 --- a/spec/javascripts/dropzone_input_spec.js +++ b/spec/javascripts/dropzone_input_spec.js @@ -13,54 +13,68 @@ const TEMPLATE = `<form class="gfm-form" data-uploads-path="${TEST_UPLOAD_PATH}" </form>`; describe('dropzone_input', () => { - let form; - let dropzone; - let xhr; - let oldXMLHttpRequest; + it('returns null when failed to initialize', () => { + const dropzone = dropzoneInput($('<form class="gfm-form"></form>')); - beforeEach(() => { - form = $(TEMPLATE); + expect(dropzone).toBeNull(); + }); - dropzone = dropzoneInput(form); + it('returns valid dropzone when successfully initialize', () => { + const dropzone = dropzoneInput($(TEMPLATE)); - xhr = jasmine.createSpyObj(Object.keys(XMLHttpRequest.prototype)); - oldXMLHttpRequest = window.XMLHttpRequest; - window.XMLHttpRequest = () => xhr; + expect(dropzone.version).toBeTruthy(); }); - afterEach(() => { - window.XMLHttpRequest = oldXMLHttpRequest; - }); + describe('shows error message', () => { + let form; + let dropzone; + let xhr; + let oldXMLHttpRequest; - it('shows error message, when AJAX fails with json', () => { - xhr = { - ...xhr, - statusCode: 400, - readyState: 4, - responseText: JSON.stringify({ message: TEST_ERROR_MESSAGE }), - getResponseHeader: () => 'application/json', - }; + beforeEach(() => { + form = $(TEMPLATE); - dropzone.processFile(TEST_FILE); + dropzone = dropzoneInput(form); - xhr.onload(); + xhr = jasmine.createSpyObj(Object.keys(XMLHttpRequest.prototype)); + oldXMLHttpRequest = window.XMLHttpRequest; + window.XMLHttpRequest = () => xhr; + }); - expect(form.find('.uploading-error-message').text()).toEqual(TEST_ERROR_MESSAGE); - }); + afterEach(() => { + window.XMLHttpRequest = oldXMLHttpRequest; + }); + + it('when AJAX fails with json', () => { + xhr = { + ...xhr, + statusCode: 400, + readyState: 4, + responseText: JSON.stringify({ message: TEST_ERROR_MESSAGE }), + getResponseHeader: () => 'application/json', + }; + + dropzone.processFile(TEST_FILE); + + xhr.onload(); + + expect(form.find('.uploading-error-message').text()).toEqual(TEST_ERROR_MESSAGE); + }); - it('shows error message, when AJAX fails with text', () => { - xhr = { - ...xhr, - statusCode: 400, - readyState: 4, - responseText: TEST_ERROR_MESSAGE, - getResponseHeader: () => 'text/plain', - }; + it('when AJAX fails with text', () => { + xhr = { + ...xhr, + statusCode: 400, + readyState: 4, + responseText: TEST_ERROR_MESSAGE, + getResponseHeader: () => 'text/plain', + }; - dropzone.processFile(TEST_FILE); + dropzone.processFile(TEST_FILE); - xhr.onload(); + xhr.onload(); - expect(form.find('.uploading-error-message').text()).toEqual(TEST_ERROR_MESSAGE); + expect(form.find('.uploading-error-message').text()).toEqual(TEST_ERROR_MESSAGE); + }); }); }); diff --git a/spec/lib/banzai/filter/video_link_filter_spec.rb b/spec/lib/banzai/filter/video_link_filter_spec.rb index a395b021f32..c324c36fe4d 100644 --- a/spec/lib/banzai/filter/video_link_filter_spec.rb +++ b/spec/lib/banzai/filter/video_link_filter_spec.rb @@ -32,7 +32,7 @@ describe Banzai::Filter::VideoLinkFilter do expect(video.name).to eq 'video' expect(video['src']).to eq src - expect(video['width']).to eq "100%" + expect(video['width']).to eq "400" expect(paragraph.name).to eq 'p' diff --git a/spec/requests/api/sidekiq_metrics_spec.rb b/spec/requests/api/sidekiq_metrics_spec.rb index d6f0f48d288..438b1475c54 100644 --- a/spec/requests/api/sidekiq_metrics_spec.rb +++ b/spec/requests/api/sidekiq_metrics_spec.rb @@ -25,6 +25,10 @@ describe API::SidekiqMetrics do expect(response).to have_gitlab_http_status(200) expect(json_response).to be_a Hash + expect(json_response['jobs']).to be_a Hash + expect(json_response['jobs'].keys) + .to contain_exactly(*%w[processed failed enqueued dead]) + expect(json_response['jobs'].values).to all(be_an(Integer)) end it 'defines the `compound_metrics` endpoint' do |