Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-17 06:09:17 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-17 06:09:17 +0300
commitd9e821dbd908f40ff9828357452cd55a651283fa (patch)
treeff45e11312c7853cdf4056d26f5a8c10778a5c5a /spec/frontend/error_tracking
parentefb0c7f501e4a8883796b5acfdc584e2720febba (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/error_tracking')
-rw-r--r--spec/frontend/error_tracking/components/error_tracking_list_spec.js40
1 files changed, 40 insertions, 0 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({