mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
fix: increase timeout for executionslist tets
This commit is contained in:
parent
2cbf49e8d7
commit
ba4c3f3a35
|
@ -128,63 +128,67 @@ describe('ExecutionsList.vue', () => {
|
||||||
expect(getByTestId('execution-list-empty')).toBeInTheDocument();
|
expect(getByTestId('execution-list-empty')).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should handle selection flow when loading more items', async () => {
|
it(
|
||||||
const storeSpy = vi
|
'should handle selection flow when loading more items',
|
||||||
.spyOn(workflowsStore, 'getPastExecutions')
|
async () => {
|
||||||
.mockResolvedValueOnce(executionsData[0])
|
const storeSpy = vi
|
||||||
.mockResolvedValueOnce(executionsData[1]);
|
.spyOn(workflowsStore, 'getPastExecutions')
|
||||||
|
.mockResolvedValueOnce(executionsData[0])
|
||||||
|
.mockResolvedValueOnce(executionsData[1]);
|
||||||
|
|
||||||
const { getByTestId, getAllByTestId, queryByTestId } = renderComponent({
|
const { getByTestId, getAllByTestId, queryByTestId } = renderComponent({
|
||||||
global: {
|
global: {
|
||||||
plugins: [pinia],
|
plugins: [pinia],
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
await waitAllPromises();
|
await waitAllPromises();
|
||||||
|
|
||||||
expect(storeSpy).toHaveBeenCalledTimes(1);
|
expect(storeSpy).toHaveBeenCalledTimes(1);
|
||||||
|
|
||||||
await userEvent.click(getByTestId('select-visible-executions-checkbox'));
|
await userEvent.click(getByTestId('select-visible-executions-checkbox'));
|
||||||
|
|
||||||
await retry(() =>
|
await retry(() =>
|
||||||
|
expect(
|
||||||
|
getAllByTestId('select-execution-checkbox').filter((el) =>
|
||||||
|
el.contains(el.querySelector(':checked')),
|
||||||
|
).length,
|
||||||
|
).toBe(10),
|
||||||
|
);
|
||||||
|
expect(getByTestId('select-all-executions-checkbox')).toBeInTheDocument();
|
||||||
|
expect(getByTestId('selected-executions-info').textContent).toContain(10);
|
||||||
|
|
||||||
|
await userEvent.click(getByTestId('load-more-button'));
|
||||||
|
|
||||||
|
expect(storeSpy).toHaveBeenCalledTimes(2);
|
||||||
|
expect(getAllByTestId('select-execution-checkbox').length).toBe(20);
|
||||||
expect(
|
expect(
|
||||||
getAllByTestId('select-execution-checkbox').filter((el) =>
|
getAllByTestId('select-execution-checkbox').filter((el) =>
|
||||||
el.contains(el.querySelector(':checked')),
|
el.contains(el.querySelector(':checked')),
|
||||||
).length,
|
).length,
|
||||||
).toBe(10),
|
).toBe(10);
|
||||||
);
|
|
||||||
expect(getByTestId('select-all-executions-checkbox')).toBeInTheDocument();
|
|
||||||
expect(getByTestId('selected-executions-info').textContent).toContain(10);
|
|
||||||
|
|
||||||
await userEvent.click(getByTestId('load-more-button'));
|
await userEvent.click(getByTestId('select-all-executions-checkbox'));
|
||||||
|
expect(getAllByTestId('select-execution-checkbox').length).toBe(20);
|
||||||
|
expect(
|
||||||
|
getAllByTestId('select-execution-checkbox').filter((el) =>
|
||||||
|
el.contains(el.querySelector(':checked')),
|
||||||
|
).length,
|
||||||
|
).toBe(20);
|
||||||
|
expect(getByTestId('selected-executions-info').textContent).toContain(20);
|
||||||
|
|
||||||
expect(storeSpy).toHaveBeenCalledTimes(2);
|
await userEvent.click(getAllByTestId('select-execution-checkbox')[2]);
|
||||||
expect(getAllByTestId('select-execution-checkbox').length).toBe(20);
|
expect(getAllByTestId('select-execution-checkbox').length).toBe(20);
|
||||||
expect(
|
expect(
|
||||||
getAllByTestId('select-execution-checkbox').filter((el) =>
|
getAllByTestId('select-execution-checkbox').filter((el) =>
|
||||||
el.contains(el.querySelector(':checked')),
|
el.contains(el.querySelector(':checked')),
|
||||||
).length,
|
).length,
|
||||||
).toBe(10);
|
).toBe(19);
|
||||||
|
expect(getByTestId('selected-executions-info').textContent).toContain(19);
|
||||||
await userEvent.click(getByTestId('select-all-executions-checkbox'));
|
expect(getByTestId('select-visible-executions-checkbox')).toBeInTheDocument();
|
||||||
expect(getAllByTestId('select-execution-checkbox').length).toBe(20);
|
expect(queryByTestId('select-all-executions-checkbox')).not.toBeInTheDocument();
|
||||||
expect(
|
},
|
||||||
getAllByTestId('select-execution-checkbox').filter((el) =>
|
{ timeout: 10000 },
|
||||||
el.contains(el.querySelector(':checked')),
|
);
|
||||||
).length,
|
|
||||||
).toBe(20);
|
|
||||||
expect(getByTestId('selected-executions-info').textContent).toContain(20);
|
|
||||||
|
|
||||||
await userEvent.click(getAllByTestId('select-execution-checkbox')[2]);
|
|
||||||
expect(getAllByTestId('select-execution-checkbox').length).toBe(20);
|
|
||||||
expect(
|
|
||||||
getAllByTestId('select-execution-checkbox').filter((el) =>
|
|
||||||
el.contains(el.querySelector(':checked')),
|
|
||||||
).length,
|
|
||||||
).toBe(19);
|
|
||||||
expect(getByTestId('selected-executions-info').textContent).toContain(19);
|
|
||||||
expect(getByTestId('select-visible-executions-checkbox')).toBeInTheDocument();
|
|
||||||
expect(queryByTestId('select-all-executions-checkbox')).not.toBeInTheDocument();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should show "retry" data when appropriate', async () => {
|
it('should show "retry" data when appropriate', async () => {
|
||||||
vi.spyOn(workflowsStore, 'getPastExecutions').mockResolvedValue(executionsData[0]);
|
vi.spyOn(workflowsStore, 'getPastExecutions').mockResolvedValue(executionsData[0]);
|
||||||
|
|
Loading…
Reference in a new issue