renderIssueApp();
expect(await ui.issueItems.findAll()).toHaveLength(7);
- expect(ui.issueItem9.query()).not.toBeInTheDocument();
+ expect(ui.issueItem8.query()).not.toBeInTheDocument();
await user.click(screen.getByRole('button', { name: 'show_more' }));
- expect(ui.issueItems.getAll()).toHaveLength(9);
- expect(ui.issueItem9.get()).toBeInTheDocument();
+ expect(ui.issueItems.getAll()).toHaveLength(10);
+ expect(ui.issueItem8.get()).toBeInTheDocument();
});
it('should be able to select issues for bulk change', async () => {
};
fetchMoreIssues = async () => {
- const { paging } = this.state;
+ const { paging, issues } = this.state;
if (!paging) {
throw new Error('Paging is not defined');
// In some cases, we can get an issue that we already have in the list as the first issue
// When this happens, we filter it out
// @see this.fetchIssuesUntil
- const firstIssueKey = response.issues[0]?.key;
+ const firstIssueKey = issues[0]?.key;
response.issues = response.issues.filter((issue) => issue.key !== firstIssueKey);
if (this.mounted) {