Skip to content

Commit 2aec5f5

Browse files
committed
test(bulk-import): add mock handler for catalog API locations in test fixtures
Signed-off-by: Dominik Augustín <daugusti@redhat.com>
1 parent ef1d76d commit 2aec5f5

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

  • workspaces/bulk-import/plugins/bulk-import-backend/__fixtures__

workspaces/bulk-import/plugins/bulk-import-backend/__fixtures__/handlers.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ export const LOCAL_ADDR = `http://${localHostAndPort}`;
2121

2222
export const LOCAL_GITLAB_ADDR = `https://gitlab.com/api/v4`;
2323

24+
const CATALOG_API_LOCATIONS_LOCAL_ADDR =
25+
/^https?:\/\/localhost:\d+\/api\/catalog\/locations$/;
26+
2427
export function loadTestFixture(filePathFromFixturesDir: string) {
2528
return require(`${__dirname}/${filePathFromFixturesDir}`);
2629
}
@@ -495,4 +498,8 @@ export const DEFAULT_TEST_HANDLERS: RestHandler<
495498
return res(ctx.status(404));
496499
},
497500
),
501+
502+
rest.get(CATALOG_API_LOCATIONS_LOCAL_ADDR, (_, res, ctx) =>
503+
res(ctx.status(200), ctx.json([])),
504+
),
498505
];

0 commit comments

Comments
 (0)