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:
Diffstat (limited to 'spec/frontend/repository/components/tree_content_spec.js')
-rw-r--r--spec/frontend/repository/components/tree_content_spec.js21
1 files changed, 7 insertions, 14 deletions
diff --git a/spec/frontend/repository/components/tree_content_spec.js b/spec/frontend/repository/components/tree_content_spec.js
index c0eb65b28fe..311e5ca86f8 100644
--- a/spec/frontend/repository/components/tree_content_spec.js
+++ b/spec/frontend/repository/components/tree_content_spec.js
@@ -162,26 +162,19 @@ describe('Repository table component', () => {
describe('commit data', () => {
const path = '';
- it('loads commit data for both top and bottom batches when row-appear event is emitted', () => {
- const rowNumber = 50;
-
+ it('loads commit data for the nearest page', () => {
createComponent({ path });
- findFileTable().vm.$emit('row-appear', rowNumber);
+ findFileTable().vm.$emit('row-appear', 49);
+ findFileTable().vm.$emit('row-appear', 15);
- expect(isRequested).toHaveBeenCalledWith(rowNumber);
+ expect(isRequested).toHaveBeenCalledWith(49);
+ expect(isRequested).toHaveBeenCalledWith(15);
expect(loadCommits.mock.calls).toEqual([
- ['', path, '', rowNumber, 'heads'],
- ['', path, '', rowNumber - 25, 'heads'],
+ ['', path, '', 25, 'heads'],
+ ['', path, '', 0, 'heads'],
]);
});
-
- it('loads commit data once if rowNumber is zero', () => {
- createComponent({ path });
- findFileTable().vm.$emit('row-appear', 0);
-
- expect(loadCommits.mock.calls).toEqual([['', path, '', 0, 'heads']]);
- });
});
describe('error handling', () => {