summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/factories/lists.rb1
-rw-r--r--spec/fixtures/api/schemas/list.json3
-rw-r--r--spec/fixtures/api/schemas/public_api/v4/board.json3
-rw-r--r--spec/frontend/repository/log_tree_spec.js19
-rw-r--r--spec/frontend/repository/utils/commit_spec.js3
-rw-r--r--spec/lib/gitlab/graphql/connections/keyset/connection_spec.rb20
-rw-r--r--spec/lib/gitlab/import_export/safe_model_attributes.yml1
-rw-r--r--spec/rubocop/cop/graphql/authorize_types_spec.rb10
8 files changed, 36 insertions, 24 deletions
diff --git a/spec/factories/lists.rb b/spec/factories/lists.rb
index eb6f0f27917..cf00351b231 100644
--- a/spec/factories/lists.rb
+++ b/spec/factories/lists.rb
@@ -6,6 +6,7 @@ FactoryBot.define do
label
list_type { :label }
max_issue_count { 0 }
+ max_issue_weight { 0 }
sequence(:position)
end
diff --git a/spec/fixtures/api/schemas/list.json b/spec/fixtures/api/schemas/list.json
index 7603892e198..760dcb96252 100644
--- a/spec/fixtures/api/schemas/list.json
+++ b/spec/fixtures/api/schemas/list.json
@@ -36,7 +36,8 @@
},
"title": { "type": "string" },
"position": { "type": ["integer", "null"] },
- "max_issue_count": { "type": "integer" }
+ "max_issue_count": { "type": "integer" },
+ "max_issue_weight": { "type": "integer" }
},
"additionalProperties": true
}
diff --git a/spec/fixtures/api/schemas/public_api/v4/board.json b/spec/fixtures/api/schemas/public_api/v4/board.json
index 8dc3999baa2..e4933ee0b93 100644
--- a/spec/fixtures/api/schemas/public_api/v4/board.json
+++ b/spec/fixtures/api/schemas/public_api/v4/board.json
@@ -77,7 +77,8 @@
}
},
"position": { "type": ["integer", "null"] },
- "max_issue_count": { "type": "integer" }
+ "max_issue_count": { "type": "integer" },
+ "max_issue_weight": { "type": "integer" }
},
"additionalProperties": false
}
diff --git a/spec/frontend/repository/log_tree_spec.js b/spec/frontend/repository/log_tree_spec.js
index 9199c726680..4271a038680 100644
--- a/spec/frontend/repository/log_tree_spec.js
+++ b/spec/frontend/repository/log_tree_spec.js
@@ -21,11 +21,18 @@ describe('resolveCommit', () => {
entry: { name: 'index.js', type: 'blob' },
resolve: jest.fn(),
};
- const commits = [{ fileName: 'index.js', type: 'blob' }];
-
- resolveCommit(commits, resolver);
-
- expect(resolver.resolve).toHaveBeenCalledWith({ fileName: 'index.js', type: 'blob' });
+ const commits = [
+ { fileName: 'index.js', filePath: '/index.js', type: 'blob' },
+ { fileName: 'index.js', filePath: '/app/assets/index.js', type: 'blob' },
+ ];
+
+ resolveCommit(commits, '', resolver);
+
+ expect(resolver.resolve).toHaveBeenCalledWith({
+ fileName: 'index.js',
+ filePath: '/index.js',
+ type: 'blob',
+ });
});
});
@@ -84,6 +91,7 @@ describe('fetchLogsTree', () => {
commitPath: 'https://test.com',
committedDate: '2019-01-01',
fileName: 'index.js',
+ filePath: '/index.js',
message: 'testing message',
sha: '123',
type: 'blob',
@@ -101,6 +109,7 @@ describe('fetchLogsTree', () => {
commitPath: 'https://test.com',
committedDate: '2019-01-01',
fileName: 'index.js',
+ filePath: '/index.js',
message: 'testing message',
sha: '123',
type: 'blob',
diff --git a/spec/frontend/repository/utils/commit_spec.js b/spec/frontend/repository/utils/commit_spec.js
index 2d75358106c..e7cc28178bf 100644
--- a/spec/frontend/repository/utils/commit_spec.js
+++ b/spec/frontend/repository/utils/commit_spec.js
@@ -15,13 +15,14 @@ const mockData = [
describe('normalizeData', () => {
it('normalizes data into LogTreeCommit object', () => {
- expect(normalizeData(mockData)).toEqual([
+ expect(normalizeData(mockData, '')).toEqual([
{
sha: '123',
message: 'testing message',
committedDate: '2019-01-01',
commitPath: 'https://test.com',
fileName: 'index.js',
+ filePath: '/index.js',
type: 'blob',
__typename: 'LogTreeCommit',
},
diff --git a/spec/lib/gitlab/graphql/connections/keyset/connection_spec.rb b/spec/lib/gitlab/graphql/connections/keyset/connection_spec.rb
index 9dda2a41ec6..36955019863 100644
--- a/spec/lib/gitlab/graphql/connections/keyset/connection_spec.rb
+++ b/spec/lib/gitlab/graphql/connections/keyset/connection_spec.rb
@@ -218,23 +218,11 @@ describe Gitlab::Graphql::Connections::Keyset::Connection do
end
end
- # TODO Enable this as part of below issue
- # https://gitlab.com/gitlab-org/gitlab/issues/32933
- # context 'when an invalid cursor is provided' do
- # let(:arguments) { { before: 'invalidcursor' } }
- #
- # it 'raises an error' do
- # expect { expect(subject.sliced_nodes) }.to raise_error(Gitlab::Graphql::Errors::ArgumentError)
- # end
- # end
-
- # TODO Remove this as part of below issue
- # https://gitlab.com/gitlab-org/gitlab/issues/32933
- context 'when an old style cursor is provided' do
- let(:arguments) { { before: Base64Bp.urlsafe_encode64(projects[1].id.to_s, padding: false) } }
+ context 'when an invalid cursor is provided' do
+ let(:arguments) { { before: Base64Bp.urlsafe_encode64('invalidcursor', padding: false) } }
- it 'only returns the project before the selected one' do
- expect(subject.sliced_nodes).to contain_exactly(projects.first)
+ it 'raises an error' do
+ expect { subject.sliced_nodes }.to raise_error(Gitlab::Graphql::Errors::ArgumentError)
end
end
end
diff --git a/spec/lib/gitlab/import_export/safe_model_attributes.yml b/spec/lib/gitlab/import_export/safe_model_attributes.yml
index e707d95bea4..704d0184cf1 100644
--- a/spec/lib/gitlab/import_export/safe_model_attributes.yml
+++ b/spec/lib/gitlab/import_export/safe_model_attributes.yml
@@ -728,6 +728,7 @@ List:
- milestone_id
- user_id
- max_issue_count
+- max_issue_weight
ExternalPullRequest:
- id
- created_at
diff --git a/spec/rubocop/cop/graphql/authorize_types_spec.rb b/spec/rubocop/cop/graphql/authorize_types_spec.rb
index af4315ecd34..98797a780e0 100644
--- a/spec/rubocop/cop/graphql/authorize_types_spec.rb
+++ b/spec/rubocop/cop/graphql/authorize_types_spec.rb
@@ -79,5 +79,15 @@ describe RuboCop::Cop::Graphql::AuthorizeTypes do
end
TYPE
end
+
+ it 'does not add an offense for Enums' do
+ expect_no_offenses(<<~TYPE)
+ module Types
+ class ATypeEnum < AnotherEnum
+ field :a_thing
+ end
+ end
+ TYPE
+ end
end
end