forked from cartsnitch/cartsnitch
fix(e2e): use more permissive regex patterns for route mocking
Use wildcard patterns to match URLs with query parameters or trailing slashes. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
committed by
Barcode Betty
parent
c47252a342
commit
5e5f13c5b5
+3
-3
@@ -15,7 +15,7 @@ const MOCK_USER_ID = "mock_user_123";
|
|||||||
const MOCK_SESSION_ID = "mock_session_456";
|
const MOCK_SESSION_ID = "mock_session_456";
|
||||||
|
|
||||||
function mockAuthRoutes(page: Page, authenticated = false) {
|
function mockAuthRoutes(page: Page, authenticated = false) {
|
||||||
page.route(/\/auth\/sign-up\/email/, async (route) => {
|
page.route(/.*\/auth\/sign-up\/email.*/, async (route) => {
|
||||||
await route.fulfill({
|
await route.fulfill({
|
||||||
status: 200,
|
status: 200,
|
||||||
contentType: "application/json",
|
contentType: "application/json",
|
||||||
@@ -41,7 +41,7 @@ function mockAuthRoutes(page: Page, authenticated = false) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
page.route(/\/auth\/sign-in\/email/, async (route) => {
|
page.route(/.*\/auth\/sign-in\/email.*/, async (route) => {
|
||||||
await route.fulfill({
|
await route.fulfill({
|
||||||
status: 200,
|
status: 200,
|
||||||
contentType: "application/json",
|
contentType: "application/json",
|
||||||
@@ -67,7 +67,7 @@ function mockAuthRoutes(page: Page, authenticated = false) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
page.route(/\/auth\/get-session/, async (route) => {
|
page.route(/.*\/auth\/get-session.*/, async (route) => {
|
||||||
if (authenticated) {
|
if (authenticated) {
|
||||||
await route.fulfill({
|
await route.fulfill({
|
||||||
status: 200,
|
status: 200,
|
||||||
|
|||||||
Reference in New Issue
Block a user