fix: 404 collisions (#15249)
* fix: 404 collisions * Added E2E test * Removed await * Attempting to fix E2E * fingers crossed Signed-off-by: zomars <[email protected]> * fix: e2e tests * fix: missing navigation to 404 page * fix: don't interrupt post login navigation * fix: Expect owner as possible host for RR events --------- Signed-off-by: zomars <[email protected]> Co-authored-by: Omar López <[email protected]>
This commit is contained in:
1 parent
ac3fb0a1cd
commit
5d01eb2f38
10 files changed
+17
-110
No files matched your search
@@ -153,6 +153,13 @@ testBothFutureAndLegacyRoutes.describe("pro user", () => {
|
||||
await expect(page).toHaveURL(new RegExp(`${pro.username}/${eventType.slug}`));
|
||||
});
|
||||
|
||||
test("it returns a 404 when a requested event type does not exist", async ({ page, users }) => {
|
||||
const [pro] = users.get();
|
||||
const unexistingPageUrl = new URL(`${pro.username}/invalid-event-type`, WEBAPP_URL);
|
||||
const response = await page.goto(unexistingPageUrl.href);
|
||||
expect(response?.status()).toBe(404);
|
||||
});
|
||||
|
||||
test("Can cancel the recently created booking and rebook the same timeslot", async ({
|
||||
page,
|
||||
users,
|
||||
|
||||
@@ -370,4 +370,5 @@ export async function doOnOrgDomain(
|
||||
|
||||
// When App directory is there, this is the 404 page text. We should work on fixing the 404 page as it changed due to app directory.
|
||||
export const NotFoundPageTextAppDir = "This page does not exist.";
|
||||
export const NotFoundPageTextPages = "404: This page could not be found.";
|
||||
// export const NotFoundPageText = "ERROR 404";
|
||||
@@ -83,9 +83,6 @@ test.describe("2FA Tests", async () => {
|
||||
page.waitForResponse("**/api/auth/callback/credentials**"),
|
||||
]);
|
||||
const shellLocator = page.locator(`[data-testid=dashboard-shell]`);
|
||||
|
||||
// expects the home page for an authorized user
|
||||
await page.goto("/");
|
||||
await expect(shellLocator).toBeVisible();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -10,7 +10,6 @@ import { test } from "../lib/fixtures";
|
||||
import {
|
||||
bookTimeSlot,
|
||||
doOnOrgDomain,
|
||||
NotFoundPageTextAppDir,
|
||||
selectFirstAvailableTimeSlotNextMonth,
|
||||
testName,
|
||||
} from "../lib/testUtils";
|
||||
@@ -184,10 +183,7 @@ test.describe("Bookings", () => {
|
||||
});
|
||||
|
||||
const event = await user.getFirstEventAsOwner();
|
||||
await page.goto(`/${user.username}/${event.slug}`);
|
||||
|
||||
// Shouldn't be servable on the non-org domain
|
||||
await expect(page.locator(`text=${NotFoundPageTextAppDir}`)).toBeVisible();
|
||||
await expectPageToBeNotFound({ page, url: `/${user.username}/${event.slug}` });
|
||||
|
||||
await doOnOrgDomain(
|
||||
{
|
||||
@@ -523,5 +519,5 @@ async function bookTeamEvent({
|
||||
|
||||
async function expectPageToBeNotFound({ page, url }: { page: Page; url: string }) {
|
||||
await page.goto(`${url}`);
|
||||
await expect(page.locator(`text=${NotFoundPageTextAppDir}`)).toBeVisible();
|
||||
await expect(page.getByTestId(`404-page`)).toBeVisible();
|
||||
}
|
||||
@@ -149,7 +149,7 @@ testBothFutureAndLegacyRoutes.describe("Teams - NonOrg", (routeVariant) => {
|
||||
// The title of the booking
|
||||
const bookingTitle = await page.getByTestId("booking-title").textContent();
|
||||
expect(
|
||||
teamMatesObj?.some((teamMate) => {
|
||||
teamMatesObj.concat([{ name: owner.name! }]).some((teamMate) => {
|
||||
const BookingTitle = `${teamEventTitle} between ${teamMate.name} and ${testName}`;
|
||||
return BookingTitle === bookingTitle;
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user