test: Add mock handler for repository_parameters
This adds mock handler for newly used `repository_parameters` end point, ensuring the warning about missing handler is not being printed to test output when runnning `npm run test`.
This commit is contained in:
parent
4ead145e38
commit
839559d42c
2 changed files with 39 additions and 0 deletions
35
src/test/fixtures/repositories.ts
vendored
35
src/test/fixtures/repositories.ts
vendored
|
|
@ -680,3 +680,38 @@ export const mockPopularRepo = (repo_id: string) => {
|
|||
};
|
||||
}
|
||||
};
|
||||
|
||||
export const mockRepositoryParameters = {
|
||||
distribution_versions: [
|
||||
{
|
||||
name: 'Any',
|
||||
label: 'any',
|
||||
},
|
||||
{
|
||||
name: 'el8',
|
||||
label: '8',
|
||||
},
|
||||
{
|
||||
name: 'el9',
|
||||
label: '9',
|
||||
},
|
||||
{
|
||||
name: 'el10',
|
||||
label: '10',
|
||||
},
|
||||
],
|
||||
distribution_arches: [
|
||||
{
|
||||
name: 'Any',
|
||||
label: 'any',
|
||||
},
|
||||
{
|
||||
name: 'aarch64',
|
||||
label: 'aarch64',
|
||||
},
|
||||
{
|
||||
name: 'x86_64',
|
||||
label: 'x86_64',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ import {
|
|||
} from '../fixtures/packages';
|
||||
import {
|
||||
mockPopularRepo,
|
||||
mockRepositoryParameters,
|
||||
mockRepositoryResults,
|
||||
} from '../fixtures/repositories';
|
||||
import { mockSourcesByProvider, mockUploadInfo } from '../fixtures/sources';
|
||||
|
|
@ -132,6 +133,9 @@ export const handlers = [
|
|||
const { repo_id } = params;
|
||||
return HttpResponse.json(mockPopularRepo(repo_id));
|
||||
}),
|
||||
http.get(`${CONTENT_SOURCES_API}/repository_parameters`, () => {
|
||||
return HttpResponse.json(mockRepositoryParameters());
|
||||
}),
|
||||
http.get(`${IMAGE_BUILDER_API}/composes`, ({ request }) => {
|
||||
return HttpResponse.json(composesEndpoint(new URL(request.url)));
|
||||
}),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue