diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.test.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.test.tsx index eb8c1f3a2c..18ce8d2c76 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.test.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/BitbucketRepoPicker.test.tsx @@ -189,6 +189,7 @@ describe('BitbucketRepoPicker', () => { describe('autocompletion', () => { it('should populate workspaces if host is set and accessToken is provided', async () => { const onChange = jest.fn(); + const { getAllByRole, getByText } = render( { it('should populate projects if host and workspace are set and accessToken is provided', async () => { const onChange = jest.fn(); + const { getAllByRole, getByText } = render( { it('should populate repositories if host, workspace and project are set and accessToken is provided', async () => { const onChange = jest.fn(); + render( { } // Verify that selecting an option calls onChange - await userEvent.click(getByText('foo')); - expect(onChange).toHaveBeenCalledWith('foo'); + await userEvent.click(getByText(availableRepos[0])); + expect(onChange).toHaveBeenCalledWith(availableRepos[0]); }); });