test: clean up tests
Signed-off-by: Benjamin Janssens <benji.janssens@gmail.com>
This commit is contained in:
@@ -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(
|
||||
<TestApiProvider apis={[[scaffolderApiRef, scaffolderApiMock]]}>
|
||||
<BitbucketRepoPicker
|
||||
@@ -218,6 +219,7 @@ describe('BitbucketRepoPicker', () => {
|
||||
|
||||
it('should populate projects if host and workspace are set and accessToken is provided', async () => {
|
||||
const onChange = jest.fn();
|
||||
|
||||
const { getAllByRole, getByText } = render(
|
||||
<TestApiProvider apis={[[scaffolderApiRef, scaffolderApiMock]]}>
|
||||
<BitbucketRepoPicker
|
||||
@@ -245,6 +247,7 @@ describe('BitbucketRepoPicker', () => {
|
||||
|
||||
it('should populate repositories if host, workspace and project are set and accessToken is provided', async () => {
|
||||
const onChange = jest.fn();
|
||||
|
||||
render(
|
||||
<TestApiProvider apis={[[scaffolderApiRef, scaffolderApiMock]]}>
|
||||
<BitbucketRepoPicker
|
||||
|
||||
+2
-2
@@ -103,7 +103,7 @@ describe('RepoUrlPickerRepoName', () => {
|
||||
}
|
||||
|
||||
// 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]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user