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:
regexowl 2025-06-20 09:02:01 +02:00 committed by Klara Simickova
parent 4ead145e38
commit 839559d42c
2 changed files with 39 additions and 0 deletions

View file

@ -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',
},
],
};

View file

@ -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)));
}),