diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-26 00:06:20 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-26 00:06:20 +0300 |
commit | e95a97594ae2da675cb80fdb2ecb2ae64526d1d4 (patch) | |
tree | d7ea0e8380e99b53d0103a851400a8b3d4a62e02 /spec | |
parent | 6ac3c67986a7007aa93a22843085e5a87b55f61a (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r-- | spec/frontend/error_tracking/store/getters_spec.js | 33 | ||||
-rw-r--r-- | spec/lib/gitlab/gitaly_client_spec.rb | 2 |
2 files changed, 35 insertions, 0 deletions
diff --git a/spec/frontend/error_tracking/store/getters_spec.js b/spec/frontend/error_tracking/store/getters_spec.js new file mode 100644 index 00000000000..371dfae373b --- /dev/null +++ b/spec/frontend/error_tracking/store/getters_spec.js @@ -0,0 +1,33 @@ +import * as getters from '~/error_tracking/store/getters'; + +describe('Error Tracking getters', () => { + let state; + + const mockErrors = [ + { title: 'ActiveModel::MissingAttributeError: missing attribute: encrypted_password' }, + { title: 'Grape::Exceptions::MethodNotAllowed: Grape::Exceptions::MethodNotAllowed' }, + { title: 'NoMethodError: undefined method `sanitize_http_headers=' }, + { title: 'NoMethodError: undefined method `pry' }, + ]; + + beforeEach(() => { + state = { + errors: mockErrors, + }; + }); + + describe('search results', () => { + it('should return errors filtered by words in title matching the query', () => { + const filteredErrors = getters.filterErrorsByTitle(state)('NoMethod'); + + expect(filteredErrors).not.toContainEqual(mockErrors[0]); + expect(filteredErrors.length).toBe(2); + }); + + it('should not return results if there is no matching query', () => { + const filteredErrors = getters.filterErrorsByTitle(state)('GitLab'); + + expect(filteredErrors.length).toBe(0); + }); + }); +}); diff --git a/spec/lib/gitlab/gitaly_client_spec.rb b/spec/lib/gitlab/gitaly_client_spec.rb index ea3bb12d049..67fe89f3fbe 100644 --- a/spec/lib/gitlab/gitaly_client_spec.rb +++ b/spec/lib/gitlab/gitaly_client_spec.rb @@ -377,6 +377,8 @@ describe Gitlab::GitalyClient do context 'when the request store is active', :request_store do it 'records call details if a RPC is called' do + expect(described_class).to receive(:measure_timings).and_call_original + gitaly_server.server_version expect(described_class.list_call_details).not_to be_empty |