Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

test: await rendered DatabaseTab controls before clicking (#9965)

Adam Eivy2295792f7f8f
diff --git a/client/src/components/settings/DatabaseTab.test.jsx b/client/src/components/settings/DatabaseTab.test.jsx
index d716bcd82a..fa5688d2e2 100644
--- a/client/src/components/settings/DatabaseTab.test.jsx
+++ b/client/src/components/settings/DatabaseTab.test.jsx
@@ -114,7 +114,7 @@ describe('DatabaseTab sync and replacement', () => {
render(<DatabaseTab />);
await waitFor(() => expect(getDatabaseStatus).toHaveBeenCalled());
- fireEvent.click(screen.getByRole('button', { name: /Replace data from Docker/i }));
+ fireEvent.click(await screen.findByRole('button', { name: /Replace data from Docker/i }));
expect(screen.getByText(/Replace Native data with Docker data\?/i)).toBeTruthy();
expect(screen.getByText(/This replaces matching tables and their records/i)).toBeTruthy();
@@ -133,7 +133,7 @@ describe('DatabaseTab sync and replacement', () => {
render(<DatabaseTab />);
await waitFor(() => expect(getDatabaseStatus).toHaveBeenCalled());
- fireEvent.click(screen.getByRole('button', { name: /Replace data from Docker/i }));
+ fireEvent.click(await screen.findByRole('button', { name: /Replace data from Docker/i }));
expect(screen.getByRole('button', { name: /Replace Native data/i })).toBeTruthy();
});
@@ -149,7 +149,7 @@ describe('DatabaseTab sync and replacement', () => {
render(<DatabaseTab />);
await waitFor(() => expect(getDatabaseStatus).toHaveBeenCalled());
- fireEvent.click(screen.getByRole('button', { name: /Destroy$/i }));
+ fireEvent.click(await screen.findByRole('button', { name: /Destroy$/i }));
expect(screen.getByRole('button', { name: /Delete Docker database/i })).toBeTruthy();
});
@@ -167,7 +167,7 @@ describe('DatabaseTab sync and replacement', () => {
render(<DatabaseTab />);
await waitFor(() => expect(getDatabaseStatus).toHaveBeenCalled());
- fireEvent.click(screen.getByRole('button', { name: /Replace data from Docker/i }));
+ fireEvent.click(await screen.findByRole('button', { name: /Replace data from Docker/i }));
fireEvent.click(screen.getByRole('button', { name: /Cancel/i }));
expect(syncDatabaseMock).not.toHaveBeenCalled();