diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-09 06:09:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-09 06:09:09 +0300 |
commit | 9627be559df06d4becd34a15972f11cadc588344 (patch) | |
tree | c2a800d006638531b954195e4afa24b91ab34863 /spec | |
parent | bded2fb7888ecf5af057a1d879ea9d85c2fea060 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r-- | spec/frontend/boards/components/board_list_header_spec.js | 12 | ||||
-rw-r--r-- | spec/models/sent_notification_spec.rb | 22 | ||||
-rw-r--r-- | spec/requests/api/graphql/group/dependency_proxy_blobs_spec.rb | 46 |
3 files changed, 58 insertions, 22 deletions
diff --git a/spec/frontend/boards/components/board_list_header_spec.js b/spec/frontend/boards/components/board_list_header_spec.js index d4489b3c535..ad2674f9d3b 100644 --- a/spec/frontend/boards/components/board_list_header_spec.js +++ b/spec/frontend/boards/components/board_list_header_spec.js @@ -105,6 +105,18 @@ describe('Board List Header Component', () => { const findCaret = () => wrapper.findByTestId('board-title-caret'); const findNewIssueButton = () => wrapper.findByTestId('newIssueBtn'); const findSettingsButton = () => wrapper.findByTestId('settingsBtn'); + const findBoardListHeader = () => wrapper.findByTestId('board-list-header'); + + it('renders border when label color is present', () => { + createComponent({ listType: ListType.label }); + + expect(findBoardListHeader().classes()).toContain( + 'gl-border-t-solid', + 'gl-border-4', + 'gl-rounded-top-left-base', + 'gl-rounded-top-right-base', + ); + }); describe('Add issue button', () => { const hasNoAddButton = [ListType.closed]; diff --git a/spec/models/sent_notification_spec.rb b/spec/models/sent_notification_spec.rb index aa515952c2b..8194150532d 100644 --- a/spec/models/sent_notification_spec.rb +++ b/spec/models/sent_notification_spec.rb @@ -326,26 +326,4 @@ RSpec.describe SentNotification do end end end - - describe "#position=" do - subject { build(:sent_notification, noteable: create(:issue)) } - - it "doesn't accept non-hash JSON passed as a string" do - subject.position = "true" - - expect(subject.attributes_before_type_cast["position"]).to be(nil) - end - - it "does accept a position hash as a string" do - subject.position = '{ "base_sha": "test" }' - - expect(subject.position.base_sha).to eq("test") - end - - it "does accept a hash" do - subject.position = { "base_sha" => "test" } - - expect(subject.position.base_sha).to eq("test") - end - end end diff --git a/spec/requests/api/graphql/group/dependency_proxy_blobs_spec.rb b/spec/requests/api/graphql/group/dependency_proxy_blobs_spec.rb index a6eb114a279..961de84234c 100644 --- a/spec/requests/api/graphql/group/dependency_proxy_blobs_spec.rb +++ b/spec/requests/api/graphql/group/dependency_proxy_blobs_spec.rb @@ -27,6 +27,7 @@ RSpec.describe 'getting dependency proxy blobs in a group', feature_category: :d dependencyProxyBlobCount dependencyProxyTotalSize dependencyProxyTotalSizeInBytes + dependencyProxyTotalSizeBytes GQL end @@ -132,4 +133,49 @@ RSpec.describe 'getting dependency proxy blobs in a group', feature_category: :d expected_size = blobs.inject(0) { |sum, blob| sum + blob.size } expect(dependency_proxy_total_size_in_bytes_response).to eq(expected_size) end + + context 'with a giant size blob' do + let_it_be(:owner) { create(:user) } + let_it_be_with_reload(:group) { create(:group) } + let_it_be(:blob) do + create(:dependency_proxy_blob, file_name: 'blob2.json', group: group, size: GraphQL::Types::Int::MAX + 1) + end + + let_it_be(:blobs) { [blob].flatten } + + context 'using dependencyProxyTotalSizeInBytes' do + let(:fields) do + <<~GQL + #{query_graphql_field('dependency_proxy_blobs', {}, dependency_proxy_blob_fields)} + dependencyProxyTotalSizeInBytes + GQL + end + + it 'returns an error' do + post_graphql(query, current_user: user, variables: variables) + + err_message = 'Integer out of bounds' + expect(graphql_errors).to include(a_hash_including('message' => a_string_including(err_message))) + end + end + + context 'using dependencyProxyTotalSizeBytes' do + let(:fields) do + <<~GQL + #{query_graphql_field('dependency_proxy_blobs', {}, dependency_proxy_blob_fields)} + dependencyProxyTotalSizeBytes + GQL + end + + let(:dependency_proxy_total_size_bytes_response) { graphql_data.dig('group', 'dependencyProxyTotalSizeBytes') } + + it 'returns the total size in bytes as a string' do + post_graphql(query, current_user: user, variables: variables) + + expect(graphql_errors).to be_nil + expected_size = String(blobs.inject(0) { |sum, blob| sum + blob.size }) + expect(dependency_proxy_total_size_bytes_response).to eq(expected_size) + end + end + end end |