diff options
Diffstat (limited to 'spec/frontend/error_tracking/components/error_tracking_list_spec.js')
-rw-r--r-- | spec/frontend/error_tracking/components/error_tracking_list_spec.js | 30 |
1 files changed, 23 insertions, 7 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 a9cd407f758..823f7132fdd 100644 --- a/spec/frontend/error_tracking/components/error_tracking_list_spec.js +++ b/spec/frontend/error_tracking/components/error_tracking_list_spec.js @@ -43,6 +43,8 @@ describe('ErrorTrackingList', () => { userCanEnableErrorTracking = true, showIntegratedTrackingDisabledAlert = false, integratedErrorTrackingEnabled = false, + listPath = '/error_tracking', + stubs = {}, } = {}) { wrapper = extendedWrapper( @@ -50,7 +52,7 @@ describe('ErrorTrackingList', () => { store, propsData: { indexPath: '/path', - listPath: '/error_tracking', + listPath, projectPath: 'project/test', enableErrorTrackingLink: '/link', userCanEnableErrorTracking, @@ -144,13 +146,27 @@ describe('ErrorTrackingList', () => { expect(findErrorListRows().length).toEqual(store.state.list.errors.length); }); - it('each error in a list should have a link to the error page', () => { - const errorTitle = wrapper.findAll('tbody tr a'); + describe.each([ + ['/test-project/-/error_tracking'], + ['/test-project/-/error_tracking/'], // handles leading '/' https://gitlab.com/gitlab-org/gitlab/-/issues/430211 + ])('details link', (url) => { + beforeEach(() => { + mountComponent({ + listPath: url, + stubs: { + GlTable: false, + GlLink: false, + }, + }); + }); + it('each error in a list should have a link to the error page', () => { + const errorTitle = wrapper.findAll('tbody tr a'); - errorTitle.wrappers.forEach((_, index) => { - expect(errorTitle.at(index).attributes('href')).toEqual( - expect.stringMatching(/error_tracking\/\d+\/details$/), - ); + errorTitle.wrappers.forEach((_, index) => { + expect(errorTitle.at(index).attributes('href')).toEqual( + `/test-project/-/error_tracking/${errorsList[index].id}/details`, + ); + }); }); }); |