diff --git a/packages/desktop-client/src/components/accounts/TransactionsTable.test.js b/packages/desktop-client/src/components/accounts/TransactionsTable.test.js index 5aa96f904b0ca73efd5441bb9792cbb7202baff5..671b3c55548cd4da667b410c893444949a6f6b46 100644 --- a/packages/desktop-client/src/components/accounts/TransactionsTable.test.js +++ b/packages/desktop-client/src/components/accounts/TransactionsTable.test.js @@ -1,6 +1,6 @@ import React, { useState, useEffect } from 'react'; -import { render, screen, fireEvent } from '@testing-library/react'; +import { render, screen, fireEvent, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { format as formatDate, parse as parseDate } from 'date-fns'; @@ -359,6 +359,9 @@ describe('Transactions', () => { // When reaching the bottom it shouldn't error input = await editField(container, 'notes', 4); await userEvent.type(input, '[Enter]'); + await waitFor(() => { + expect(container.querySelector('input')).toBeNull(); + }); // When reaching the top it shouldn't error input = await editField(container, 'notes', 0); diff --git a/upcoming-release-notes/780.md b/upcoming-release-notes/780.md new file mode 100644 index 0000000000000000000000000000000000000000..cbceb6a955bf1431d03630b2d6f9684725e8cd57 --- /dev/null +++ b/upcoming-release-notes/780.md @@ -0,0 +1,6 @@ +--- +category: Maintenance +authors: [MatissJanis] +--- + +Add `waitFor` to a flaky unit test to make it more stable