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', () => {
useFakeDate();
let wrapper;
const defaultProps = {
const injectedProperties = {
groupAnalyticsCoverageReportsPath: '/coverage.csv?ref_path=refs/heads/master',
};
const createComponent = () => {
wrapper = shallowMount(GroupRepositoryAnalytics, {
localVue,
propsData: {
...defaultProps,
provide: {
...injectedProperties,
},
});
};
......@@ -34,7 +34,7 @@ describe('Group repository analytics app', () => {
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
// 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.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