rtl 13 fixes for tests with type issues

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2023-10-13 09:21:51 +02:00
parent d60fbcb553
commit 0935b0d60f
33 changed files with 862 additions and 963 deletions
@@ -14,7 +14,6 @@
* limitations under the License.
*/
import { renderHook, act } from '@testing-library/react';
import { waitFor } from '@testing-library/react';
import {
mockCalverProject,
@@ -48,10 +47,9 @@ describe('useCreateReleaseCandidate', () => {
);
await act(async () => {
await waitFor(() => result.current.run());
await result.current.run();
});
expect(result.error).toEqual(undefined);
expect(result.current.responseSteps).toHaveLength(6);
});
@@ -67,7 +65,7 @@ describe('useCreateReleaseCandidate', () => {
);
await act(async () => {
await waitFor(() => result.current.run());
await result.current.run();
});
expect(result.current.responseSteps).toHaveLength(7);
@@ -15,7 +15,6 @@
*/
import { renderHook, act } from '@testing-library/react';
import { waitFor } from '@testing-library/react';
import {
mockBumpedTag,
@@ -50,10 +49,9 @@ describe('patch', () => {
);
await act(async () => {
await waitFor(() => result.current.run(mockSelectedPatchCommit));
await result.current.run(mockSelectedPatchCommit);
});
expect(result.error).toEqual(undefined);
expect(result.current.responseSteps).toHaveLength(18);
});
@@ -69,10 +67,9 @@ describe('patch', () => {
);
await act(async () => {
await waitFor(() => result.current.run(mockSelectedPatchCommit));
await result.current.run(mockSelectedPatchCommit);
});
expect(result.error).toEqual(undefined);
expect(result.current.responseSteps).toHaveLength(19);
expect(result.current).toMatchInlineSnapshot(`
{
@@ -15,8 +15,6 @@
*/
import { renderHook, act } from '@testing-library/react';
import { waitFor } from '@testing-library/react';
import {
mockCalverProject,
mockReleaseCandidateCalver,
@@ -50,10 +48,9 @@ describe('usePromoteRc', () => {
);
await act(async () => {
await waitFor(() => result.current.run());
await result.current.run();
});
expect(result.error).toEqual(undefined);
expect(result.current.responseSteps).toHaveLength(4);
});
@@ -67,7 +64,7 @@ describe('usePromoteRc', () => {
);
await act(async () => {
await waitFor(() => result.current.run());
await result.current.run();
});
expect(result.current.responseSteps).toHaveLength(5);