Commit 6f6e3f72 authored by Scott Hampton's avatar Scott Hampton

Update specs to provide path

Since we updated the component to provide
and inject the path, we need to update the
spec to provide the mock path as well.
parent d9abad9d
...@@ -8,15 +8,15 @@ describe('Group repository analytics app', () => { ...@@ -8,15 +8,15 @@ describe('Group repository analytics app', () => {
useFakeDate(); useFakeDate();
let wrapper; let wrapper;
const defaultProps = { const injectedProperties = {
groupAnalyticsCoverageReportsPath: '/coverage.csv?ref_path=refs/heads/master', groupAnalyticsCoverageReportsPath: '/coverage.csv?ref_path=refs/heads/master',
}; };
const createComponent = () => { const createComponent = () => {
wrapper = shallowMount(GroupRepositoryAnalytics, { wrapper = shallowMount(GroupRepositoryAnalytics, {
localVue, localVue,
propsData: { provide: {
...defaultProps, ...injectedProperties,
}, },
}); });
}; };
...@@ -34,7 +34,7 @@ describe('Group repository analytics app', () => { ...@@ -34,7 +34,7 @@ describe('Group repository analytics app', () => {
const reportButton = wrapper.find('[data-testid="group-code-coverage-csv-button"]'); const reportButton = wrapper.find('[data-testid="group-code-coverage-csv-button"]');
// Due to the fake_date helper, we can always expect today's date to be 2020-07-06 // Due to the fake_date helper, we can always expect today's date to be 2020-07-06
// and one year ago to be 2019-07-06 // and one year ago to be 2019-07-06
const expectedPath = `${defaultProps.groupAnalyticsCoverageReportsPath}&start_date=2019-07-06&end_date=2020-07-06`; const expectedPath = `${injectedProperties.groupAnalyticsCoverageReportsPath}&start_date=2019-07-06&end_date=2020-07-06`;
expect(reportButton.exists()).toBe(true); expect(reportButton.exists()).toBe(true);
expect(reportButton.attributes('href')).toBe(expectedPath); expect(reportButton.attributes('href')).toBe(expectedPath);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment