test: fix recording URL tests to use parsed path

This commit is contained in:
juancarmore 2025-06-10 11:03:13 +02:00
parent ada76e5c2a
commit cdcafd22d0

View File

@ -35,8 +35,12 @@ describe('Recording API Tests', () => {
const recordingUrl = response.body.url; const recordingUrl = response.body.url;
expect(recordingUrl).toBeDefined(); expect(recordingUrl).toBeDefined();
// Parse the URL to extract the path
const parsedUrl = new URL(recordingUrl);
const recordingPath = parsedUrl.pathname + parsedUrl.search;
// Verify that the URL is publicly accessible // Verify that the URL is publicly accessible
const publicResponse = await request(app).get(recordingUrl); const publicResponse = await request(app).get(recordingPath);
expect(publicResponse.status).toBe(200); expect(publicResponse.status).toBe(200);
}); });
@ -46,8 +50,12 @@ describe('Recording API Tests', () => {
const recordingUrl = response.body.url; const recordingUrl = response.body.url;
expect(recordingUrl).toBeDefined(); expect(recordingUrl).toBeDefined();
// Parse the URL to extract the path
const parsedUrl = new URL(recordingUrl);
const recordingPath = parsedUrl.pathname + parsedUrl.search;
// Verify that the URL is not publicly accessible // Verify that the URL is not publicly accessible
const publicResponse = await request(app).get(recordingUrl); const publicResponse = await request(app).get(recordingPath);
expect(publicResponse.status).toBe(401); expect(publicResponse.status).toBe(401);
}); });