diff options
Diffstat (limited to 'spec')
3 files changed, 54 insertions, 3 deletions
diff --git a/spec/frontend/error_tracking/components/error_tracking_list_spec.js b/spec/frontend/error_tracking/components/error_tracking_list_spec.js index a747e07d70d..10b24cf04d3 100644 --- a/spec/frontend/error_tracking/components/error_tracking_list_spec.js +++ b/spec/frontend/error_tracking/components/error_tracking_list_spec.js @@ -31,6 +31,8 @@ describe('ErrorTrackingList', () => { store, propsData: { indexPath: '/path', + listPath: '/error_tracking', + projectPath: 'project/test', enableErrorTrackingLink: '/link', userCanEnableErrorTracking, errorTrackingEnabled, @@ -59,6 +61,7 @@ describe('ErrorTrackingList', () => { searchByQuery: jest.fn(), sortByField: jest.fn(), fetchPaginatedResults: jest.fn(), + updateStatus: jest.fn(), }; const state = { @@ -139,6 +142,14 @@ describe('ErrorTrackingList', () => { }); }); + it('each error in the list should have an ignore button', () => { + const error = wrapper.findAll('tbody tr'); + + error.wrappers.forEach((_, index) => { + expect(error.at(index).exists('glicon-stub[name="eye-slash"]')).toBe(true); + }); + }); + describe('filtering', () => { const findSearchBox = () => wrapper.find(GlFormInput); @@ -205,6 +216,35 @@ describe('ErrorTrackingList', () => { }); }); + describe('When the ignore button on an error is clicked', () => { + beforeEach(() => { + store.state.list.loading = false; + store.state.list.errors = errorsList; + + mountComponent({ + stubs: { + GlTable: false, + GlLink: false, + GlButton: false, + }, + }); + }); + + it('sends the "ignored" status and error ID', () => { + const ignoreButton = wrapper.find({ ref: 'ignoreError' }); + ignoreButton.trigger('click'); + expect(actions.updateStatus).toHaveBeenCalledWith( + expect.anything(), + { + endpoint: '/project/test/-/error_tracking/3.json', + redirectUrl: '/error_tracking', + status: 'ignored', + }, + undefined, + ); + }); + }); + describe('When error tracking is disabled and user is not allowed to enable it', () => { beforeEach(() => { mountComponent({ diff --git a/spec/helpers/projects/error_tracking_helper_spec.rb b/spec/helpers/projects/error_tracking_helper_spec.rb index 583b1c76d7b..325ff32dd89 100644 --- a/spec/helpers/projects/error_tracking_helper_spec.rb +++ b/spec/helpers/projects/error_tracking_helper_spec.rb @@ -11,6 +11,8 @@ describe Projects::ErrorTrackingHelper do describe '#error_tracking_data' do let(:can_enable_error_tracking) { true } let(:setting_path) { project_settings_operations_path(project) } + let(:list_path) { project_error_tracking_index_path(project) } + let(:project_path) { project.full_path } let(:index_path) do project_error_tracking_index_path(project, format: :json) @@ -30,6 +32,8 @@ describe Projects::ErrorTrackingHelper do 'user-can-enable-error-tracking' => 'true', 'enable-error-tracking-link' => setting_path, 'error-tracking-enabled' => 'false', + 'list-path' => list_path, + 'project-path' => project_path, 'illustration-path' => match_asset_path('/assets/illustrations/cluster_popover.svg') ) end diff --git a/spec/lib/gitlab/import_export/import_test_coverage_spec.rb b/spec/lib/gitlab/import_export/import_test_coverage_spec.rb index d94abe613e8..97d5ce07d47 100644 --- a/spec/lib/gitlab/import_export/import_test_coverage_spec.rb +++ b/spec/lib/gitlab/import_export/import_test_coverage_spec.rb @@ -17,6 +17,7 @@ describe 'Test coverage of the Project Import' do # opening a follow-up issue to fix this. MUTED_RELATIONS = %w[ project.milestones.events.push_event_payload + project.issues.events project.issues.events.push_event_payload project.issues.notes.events project.issues.notes.events.push_event_payload @@ -55,13 +56,19 @@ describe 'Test coverage of the Project Import' do # Note that we use separate fixture to test ee-only features. # Most of the relations are present in `complex/project.json` # which is our main fixture. + PROJECT_JSON_FIXTURES_EE = + if Gitlab.ee? + ['ee/spec/fixtures/lib/gitlab/import_export/designs/project.json'].freeze + else + [] + end + PROJECT_JSON_FIXTURES = [ 'spec/fixtures/lib/gitlab/import_export/complex/project.json', 'spec/fixtures/lib/gitlab/import_export/group/project.json', 'spec/fixtures/lib/gitlab/import_export/light/project.json', - 'spec/fixtures/lib/gitlab/import_export/milestone-iid/project.json', - 'ee/spec/fixtures/lib/gitlab/import_export/designs/project.json' - ].freeze + 'spec/fixtures/lib/gitlab/import_export/milestone-iid/project.json' + ].freeze + PROJECT_JSON_FIXTURES_EE it 'ensures that all imported/exported relations are present in test JSONs' do not_tested_relations = (relations_from_config - tested_relations) - MUTED_RELATIONS |