diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-09 06:09:55 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-09 06:09:55 +0000 |
commit | 0221116862ee66024a03492b4fbbe4e069d84303 (patch) | |
tree | e0f46cc3c30534ab731af27c574183b1e222fd0e /spec/features/error_tracking | |
parent | ce130e211808c9b02116f30af4a043f1a4d3a717 (diff) | |
download | gitlab-ce-0221116862ee66024a03492b4fbbe4e069d84303.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features/error_tracking')
-rw-r--r-- | spec/features/error_tracking/user_filters_errors_by_status_spec.rb | 40 | ||||
-rw-r--r-- | spec/features/error_tracking/user_searches_sentry_errors_spec.rb | 2 |
2 files changed, 41 insertions, 1 deletions
diff --git a/spec/features/error_tracking/user_filters_errors_by_status_spec.rb b/spec/features/error_tracking/user_filters_errors_by_status_spec.rb new file mode 100644 index 00000000000..51e29e2a5ec --- /dev/null +++ b/spec/features/error_tracking/user_filters_errors_by_status_spec.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'When a user filters Sentry errors by status', :js, :use_clean_rails_memory_store_caching, :sidekiq_inline do + include_context 'sentry error tracking context feature' + + let_it_be(:issues_response_body) { fixture_file('sentry/issues_sample_response.json') } + let_it_be(:filtered_errors_by_status_response) { JSON.parse(issues_response_body).filter { |error| error['status'] == 'ignored' }.to_json } + let(:issues_api_url) { "#{sentry_api_urls.issues_url}?limit=20&query=is:unresolved" } + let(:issues_api_url_filter) { "#{sentry_api_urls.issues_url}?limit=20&query=is:ignored" } + let(:auth_token) {{ 'Authorization' => 'Bearer access_token_123' }} + let(:return_header) {{ 'Content-Type' => 'application/json' }} + + before do + stub_request(:get, issues_api_url).with(headers: auth_token) + .to_return(status: 200, body: issues_response_body, headers: return_header) + + stub_request(:get, issues_api_url_filter).with(headers: auth_token) + .to_return(status: 200, body: filtered_errors_by_status_response, headers: return_header) + end + + it 'displays the results' do + sign_in(project.owner) + visit project_error_tracking_index_path(project) + page.within(find('.gl-table')) do + results = page.all('.table-row') + expect(results.count).to be(3) + end + + find('.status-dropdown .dropdown-toggle').click + find('.dropdown-item', text: 'Ignored').click + + page.within(find('.gl-table')) do + results = page.all('.table-row') + expect(results.count).to be(1) + expect(results.first).to have_content(filtered_errors_by_status_response[0]['title']) + end + end +end diff --git a/spec/features/error_tracking/user_searches_sentry_errors_spec.rb b/spec/features/error_tracking/user_searches_sentry_errors_spec.rb index 690c60a3c3f..c5559081feb 100644 --- a/spec/features/error_tracking/user_searches_sentry_errors_spec.rb +++ b/spec/features/error_tracking/user_searches_sentry_errors_spec.rb @@ -26,7 +26,7 @@ describe 'When a user searches for Sentry errors', :js, :use_clean_rails_memory_ page.within(find('.gl-table')) do results = page.all('.table-row') - expect(results.count).to be(2) + expect(results.count).to be(3) end find('.gl-form-input').set('NotFound').native.send_keys(:return) |