test: Mock config endpoint for auth regression tests (#9635)

This commit is contained in:
Cristhian Zanforlin Lousa 2025-09-01 10:55:03 -03:00 • committed by GitHub
commit 779a37d5a9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -18,6 +18,20 @@ test(
}); });
}); });
await page.route("**/api/v1/config", (route) => {
route.fulfill({
status: 200,
contentType: "application/json",
body: JSON.stringify({
webhook_auth_enable: true,
}),
headers: {
"content-type": "application/json",
...route.request().headers(),
},
});
});
await loginLangflow(page); await loginLangflow(page);
await awaitBootstrapTest(page, { skipGoto: true }); await awaitBootstrapTest(page, { skipGoto: true });
@ -61,6 +75,20 @@ test(
"user must be able to not see api key in webhook component when auto login is enabled", "user must be able to not see api key in webhook component when auto login is enabled",
{ tag: ["@release"] }, { tag: ["@release"] },
async ({ page }) => { async ({ page }) => {
await page.route("**/api/v1/config", (route) => {
route.fulfill({
status: 200,
contentType: "application/json",
body: JSON.stringify({
webhook_auth_enable: false,
}),
headers: {
"content-type": "application/json",
...route.request().headers(),
},
});
});
await awaitBootstrapTest(page); await awaitBootstrapTest(page);
await page.waitForSelector('[data-testid="blank-flow"]', { await page.waitForSelector('[data-testid="blank-flow"]', {