Fix if-check
This commit is contained in:
parent
7a0e2426bc
commit
c4d2db1f6c
3 changed files with 15 additions and 1 deletions
|
@ -203,7 +203,7 @@ export default {
|
|||
this.showIssueForm = !this.showIssueForm;
|
||||
},
|
||||
onScroll() {
|
||||
if (!this.loadingMore && (this.scrollTop() > this.scrollHeight() - this.scrollOffset)) {
|
||||
if (!this.list.loadingMore && (this.scrollTop() > this.scrollHeight() - this.scrollOffset)) {
|
||||
this.loadNextPage();
|
||||
}
|
||||
},
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: "Fix If-Check the result that a function was executed several times"
|
||||
merge_request: 20640
|
||||
author: Max Dicker
|
||||
type: fixed
|
|
@ -200,6 +200,15 @@ describe('Board list component', () => {
|
|||
});
|
||||
});
|
||||
|
||||
it('does not load issues if already loading', () => {
|
||||
component.list.nextPage = spyOn(component.list, 'nextPage').and.returnValue(new Promise(() => {}));
|
||||
|
||||
component.onScroll();
|
||||
component.onScroll();
|
||||
|
||||
expect(component.list.nextPage).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('shows loading more spinner', (done) => {
|
||||
component.showCount = true;
|
||||
component.list.loadingMore = true;
|
||||
|
|
Loading…
Reference in a new issue