mock data
This commit is contained in:
@@ -23,6 +23,16 @@ const mockConfig = {
|
||||
setup: 'complete',
|
||||
};
|
||||
|
||||
const oidcConfig = {
|
||||
issuer: mockConfig.authority.issuer,
|
||||
authorization_endpoint: mockConfig.authority.authorizeEndpoint,
|
||||
token_endpoint: mockConfig.authority.tokenEndpoint,
|
||||
jwks_uri: 'https://authority.local/.well-known/jwks.json',
|
||||
response_types_supported: ['code'],
|
||||
subject_types_supported: ['public'],
|
||||
id_token_signing_alg_values_supported: ['RS256'],
|
||||
};
|
||||
|
||||
const doctorSession = {
|
||||
...policyAuthorSession,
|
||||
scopes: [
|
||||
@@ -107,7 +117,24 @@ async function setupDoctorPage(page: Page): Promise<void> {
|
||||
body: JSON.stringify(mockConfig),
|
||||
}),
|
||||
);
|
||||
await page.route('https://authority.local/**', (route) => route.abort());
|
||||
await page.route('https://authority.local/**', (route) => {
|
||||
const url = route.request().url();
|
||||
if (url.includes('/.well-known/openid-configuration')) {
|
||||
return route.fulfill({
|
||||
status: 200,
|
||||
contentType: 'application/json',
|
||||
body: JSON.stringify(oidcConfig),
|
||||
});
|
||||
}
|
||||
if (url.includes('/.well-known/jwks.json')) {
|
||||
return route.fulfill({
|
||||
status: 200,
|
||||
contentType: 'application/json',
|
||||
body: JSON.stringify({ keys: [] }),
|
||||
});
|
||||
}
|
||||
return route.abort();
|
||||
});
|
||||
|
||||
await page.route('**/doctor/api/v1/doctor/plugins**', (route) =>
|
||||
route.fulfill({
|
||||
|
||||
Reference in New Issue
Block a user