test(cli): refactor tests for async render utilities (#23252)

This commit is contained in:
Tommaso Sciortino
2026-03-20 20:08:29 +00:00
committed by GitHub
parent 86a3a913b5
commit 6c78eb7a39
198 changed files with 3592 additions and 4802 deletions
@@ -17,15 +17,14 @@ describe('AdminSettingsChangedDialog', () => {
});
it('renders correctly', async () => {
const { lastFrame, waitUntilReady } = await renderWithProviders(
const { lastFrame } = await renderWithProviders(
<AdminSettingsChangedDialog />,
);
await waitUntilReady();
expect(lastFrame()).toMatchSnapshot();
});
it('restarts on "r" key press', async () => {
const { stdin, waitUntilReady } = await renderWithProviders(
const { stdin } = await renderWithProviders(
<AdminSettingsChangedDialog />,
{
uiActions: {
@@ -33,7 +32,6 @@ describe('AdminSettingsChangedDialog', () => {
},
},
);
await waitUntilReady();
act(() => {
stdin.write('r');
@@ -43,7 +41,7 @@ describe('AdminSettingsChangedDialog', () => {
});
it.each(['r', 'R'])('restarts on "%s" key press', async (key) => {
const { stdin, waitUntilReady } = await renderWithProviders(
const { stdin } = await renderWithProviders(
<AdminSettingsChangedDialog />,
{
uiActions: {
@@ -51,7 +49,6 @@ describe('AdminSettingsChangedDialog', () => {
},
},
);
await waitUntilReady();
act(() => {
stdin.write(key);