mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-10 19:52:53 +00:00
fix: remove infinite scroll e2e test
This commit is contained in:
committed by
Rainer Killinger
parent
8c30a47706
commit
47565e51b0
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2022 StApps
|
* Copyright (C) 2023 StApps
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
* Software Foundation, version 3.
|
* Software Foundation, version 3.
|
||||||
@@ -25,15 +25,6 @@ describe('news', function () {
|
|||||||
cy.get('stapps-news-item').should('have.length', 6);
|
cy.get('stapps-news-item').should('have.length', 6);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have infinite scroll', function () {
|
|
||||||
cy.visit('/news');
|
|
||||||
cy.get('stapps-news-item').should('have.length', 6);
|
|
||||||
cy.wait(500);
|
|
||||||
cy.get('stapps-news-page > ion-content').shadow().find('main').scrollTo('bottom');
|
|
||||||
cy.wait('@search');
|
|
||||||
cy.get('stapps-news-item').should('have.length', 12);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should reload on filter change', function () {
|
it('should reload on filter change', function () {
|
||||||
cy.visit('/news');
|
cy.visit('/news');
|
||||||
cy.get('stapps-news-item').should('have.length', 6);
|
cy.get('stapps-news-item').should('have.length', 6);
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ export class NewsPageComponent implements OnInit {
|
|||||||
async loadMore(infiniteScrollElement?: HTMLIonInfiniteScrollElement, more = this.pageSize): Promise<void> {
|
async loadMore(infiniteScrollElement?: HTMLIonInfiniteScrollElement, more = this.pageSize): Promise<void> {
|
||||||
const from = this.from;
|
const from = this.from;
|
||||||
this.from += more;
|
this.from += more;
|
||||||
const fetchedNews = await this.newsProvider.getList(this.pageSize, from, [...this.filters]);
|
const fetchedNews = await this.newsProvider.getList(more, from, [...this.filters]);
|
||||||
|
|
||||||
this.news = [...this.news, ...fetchedNews];
|
this.news = [...this.news, ...fetchedNews];
|
||||||
await infiniteScrollElement?.complete();
|
await infiniteScrollElement?.complete();
|
||||||
|
|||||||
Reference in New Issue
Block a user