From 48ecfd3d329ebe3aceb2f1d4f46595ed9af8fc08 Mon Sep 17 00:00:00 2001 From: Alex Grozav Date: Fri, 21 Jul 2023 14:51:12 +0300 Subject: [PATCH] fix: fix source control tets --- .../src/views/__tests__/SettingsSourceControl.test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/editor-ui/src/views/__tests__/SettingsSourceControl.test.ts b/packages/editor-ui/src/views/__tests__/SettingsSourceControl.test.ts index 135603ab09..0dff8d6de5 100644 --- a/packages/editor-ui/src/views/__tests__/SettingsSourceControl.test.ts +++ b/packages/editor-ui/src/views/__tests__/SettingsSourceControl.test.ts @@ -69,7 +69,7 @@ describe('SettingsSourceControl', () => { const updatePreferencesSpy = vi.spyOn(sourceControlStore, 'updatePreferences'); - const { container, getByTestId, queryByTestId, getByRole } = renderComponent({ + const { html, container, getByTestId, getByText, queryByTestId, getByRole } = renderComponent({ pinia, global: { stubs: ['teleport'], @@ -120,10 +120,10 @@ describe('SettingsSourceControl', () => { expect(saveSettingsButton).toBeDisabled(); const branchSelect = getByTestId('source-control-branch-select'); - await userEvent.click(branchSelect); + await userEvent.click(within(branchSelect).getByRole('textbox')); - await waitFor(() => expect(within(branchSelect).getByText('main')).toBeVisible()); - await userEvent.click(within(branchSelect).getByText('main')); + await waitFor(() => expect(getByText('main')).toBeVisible()); + await userEvent.click(getByText('main')); await waitFor(() => expect(saveSettingsButton).toBeEnabled()); await userEvent.click(saveSettingsButton);