test(discovery): update tests
Signed-off-by: Benjamin Janssens <benji.janssens@gmail.com>
This commit is contained in:
+1
-25
@@ -542,31 +542,11 @@ describe('BitbucketCloudEntityProvider', () => {
|
||||
})[0];
|
||||
|
||||
server.use(
|
||||
rest.get(
|
||||
`https://api.bitbucket.org/2.0/workspaces/test-ws/projects`,
|
||||
(_req, res, ctx) => {
|
||||
const response = {
|
||||
values: [
|
||||
{
|
||||
key: 'TEST',
|
||||
},
|
||||
{
|
||||
key: 'TEST2',
|
||||
},
|
||||
],
|
||||
};
|
||||
return res(ctx.json(response));
|
||||
},
|
||||
),
|
||||
rest.get(
|
||||
`https://api.bitbucket.org/2.0/workspaces/test-ws/search/code`,
|
||||
(req, res, ctx) => {
|
||||
const query = req.url.searchParams.get('search_query');
|
||||
if (
|
||||
!query ||
|
||||
!query.includes('repo:test-repo') ||
|
||||
!query.includes('project:TEST')
|
||||
) {
|
||||
if (!query || !query.includes('repo:test-repo')) {
|
||||
return res(ctx.json({ values: [] }));
|
||||
}
|
||||
|
||||
@@ -643,10 +623,6 @@ describe('BitbucketCloudEntityProvider', () => {
|
||||
entity: addedModule,
|
||||
locationKey: 'bitbucketCloud-provider:myProvider',
|
||||
},
|
||||
{
|
||||
entity: addedModule,
|
||||
locationKey: 'bitbucketCloud-provider:myProvider',
|
||||
},
|
||||
];
|
||||
const removedEntities = [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user