diff options
Diffstat (limited to 'spec/frontend/repository')
4 files changed, 22 insertions, 7 deletions
diff --git a/spec/frontend/repository/components/table/index_spec.js b/spec/frontend/repository/components/table/index_spec.js index 2180f78a8df..8b987551b33 100644 --- a/spec/frontend/repository/components/table/index_spec.js +++ b/spec/frontend/repository/components/table/index_spec.js @@ -82,9 +82,6 @@ function factory({ path, isLoading = false, hasMore = true, entries = {}, commit mocks: { $apollo, }, - provide: { - glFeatures: { lazyLoadCommits: true }, - }, }); } diff --git a/spec/frontend/repository/components/table/row_spec.js b/spec/frontend/repository/components/table/row_spec.js index 64aa6d179a8..5d9138ab9cd 100644 --- a/spec/frontend/repository/components/table/row_spec.js +++ b/spec/frontend/repository/components/table/row_spec.js @@ -30,9 +30,6 @@ function factory(propsData = {}) { directives: { GlHoverLoad: createMockDirective(), }, - provide: { - glFeatures: { lazyLoadCommits: true }, - }, mocks: { $router, }, diff --git a/spec/frontend/repository/components/tree_content_spec.js b/spec/frontend/repository/components/tree_content_spec.js index 352f4314232..6eea66f1a7d 100644 --- a/spec/frontend/repository/components/tree_content_spec.js +++ b/spec/frontend/repository/components/tree_content_spec.js @@ -31,7 +31,6 @@ function factory(path, data = () => ({})) { glFeatures: { increasePageSizeExponentially: true, paginatedTreeGraphqlQuery: true, - lazyLoadCommits: true, }, }, }); diff --git a/spec/frontend/repository/utils/ref_switcher_utils_spec.js b/spec/frontend/repository/utils/ref_switcher_utils_spec.js new file mode 100644 index 00000000000..3335059554f --- /dev/null +++ b/spec/frontend/repository/utils/ref_switcher_utils_spec.js @@ -0,0 +1,22 @@ +import { generateRefDestinationPath } from '~/repository/utils/ref_switcher_utils'; +import setWindowLocation from 'helpers/set_window_location_helper'; + +const projectRootPath = 'root/Project1'; +const currentRef = 'main'; +const selectedRef = 'feature'; + +describe('generateRefDestinationPath', () => { + it.each` + currentPath | result + ${projectRootPath} | ${`${projectRootPath}/-/tree/${selectedRef}`} + ${`${projectRootPath}/-/tree/${currentRef}/dir1`} | ${`${projectRootPath}/-/tree/${selectedRef}/dir1`} + ${`${projectRootPath}/-/tree/${currentRef}/dir1/dir2`} | ${`${projectRootPath}/-/tree/${selectedRef}/dir1/dir2`} + ${`${projectRootPath}/-/blob/${currentRef}/test.js`} | ${`${projectRootPath}/-/blob/${selectedRef}/test.js`} + ${`${projectRootPath}/-/blob/${currentRef}/dir1/test.js`} | ${`${projectRootPath}/-/blob/${selectedRef}/dir1/test.js`} + ${`${projectRootPath}/-/blob/${currentRef}/dir1/dir2/test.js`} | ${`${projectRootPath}/-/blob/${selectedRef}/dir1/dir2/test.js`} + ${`${projectRootPath}/-/blob/${currentRef}/dir1/dir2/test.js#L123`} | ${`${projectRootPath}/-/blob/${selectedRef}/dir1/dir2/test.js#L123`} + `('generates the correct destination path for $currentPath', ({ currentPath, result }) => { + setWindowLocation(currentPath); + expect(generateRefDestinationPath(projectRootPath, selectedRef)).toBe(result); + }); +}); |