Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions e2e/uiAccessibility.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ async function setTheme(page: Page, theme: "light" | "dark") {
// Each page and an element that shows the page has finished loading
const PAGES = [
{ name: "PlantMatch", path: "", loaded: ".plant-card-front" },
{ name: "ExplorePlants", path: "explorePlants", loaded: ".plant-grid > li" },
{ name: "MyMatches", path: "my-matches", loaded: ".matches-grid" },
{ name: "Profile", path: "profile", loaded: "main.profile" },
{ name: "ExplorePlants", path: "#/explorePlants", loaded: ".plant-grid > li" },
{ name: "MyMatches", path: "#/my-matches", loaded: ".matches-grid" },
{ name: "Profile", path: "#/profile", loaded: "main.profile" },
{
name: "PlantOwnerTest",
path: "plantOwnerTest",
path: "#/plantOwnerTest",
loaded: ".plant-owner-test",
},
];
Expand All @@ -69,7 +69,7 @@ for (const theme of THEMES) {

test.describe("after interaction", () => {
test("ExplorePlants with a plant card flipped", async ({ page }) => {
await page.goto("explorePlants");
await page.goto("#/explorePlants");
const firstCard = page.locator(".plant-grid > li").first();
await firstCard
.locator(".plant-card-front .plant-card-info-button")
Expand All @@ -82,7 +82,7 @@ test.describe("after interaction", () => {
});

test("Profile with the edit tab open", async ({ page }) => {
await page.goto("profile");
await page.goto("#/profile");
await page
.getByRole("button", { name: /edit profile|endre profil/i })
.click();
Expand All @@ -92,21 +92,21 @@ test.describe("after interaction", () => {

test("MyMatches with a matched plant", async ({ page }) => {
// A new user has no matches, so add one from ExplorePlants first
await page.goto("explorePlants");
await page.goto("#/explorePlants");
const addButton = page
.locator(".plant-grid > li")
.first()
.locator(".add-match-button");
await addButton.click();
await expect(addButton).toBeDisabled();

await page.goto("my-matches");
await page.goto("#/my-matches");
await expect(page.locator(".plant-card-match")).toHaveCount(1);
await checkAccessibility(page);
});

test("PlantOwnerTest showing a result", async ({ page }) => {
await page.goto("plantOwnerTest");
await page.goto("#/plantOwnerTest");

const options = page.locator(".plant-owner-test-option");
const nextButton = page
Expand Down
2 changes: 1 addition & 1 deletion e2e/uiExplorePlants.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ test("user pages, filters, searches, opens a plant, sorts and resets", async ({
const nextButton = pagination.getByRole("button").last();

await test.step("the first page shows 12 plants sorted a–z", async () => {
await page.goto("explorePlants");
await page.goto("#/explorePlants");
await expect(cards).toHaveCount(12);
await expect(cards.first()).toContainText("Aloe Vera");
await expect(previousButton).toBeDisabled();
Expand Down
2 changes: 1 addition & 1 deletion e2e/uiMatchAndRemovePlant.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ test("user can like a plant in PlantMatch, find it in MyMatches and remove the m
test("user can add a plant from ExplorePlants and find it in MyMatches", async ({
page,
}) => {
await page.goto("explorePlants");
await page.goto("#/explorePlants");

// The first plant sorted a–z is always Aloe Vera in the fixtures
const firstCard = page.locator(".plant-grid > li").first();
Expand Down
2 changes: 1 addition & 1 deletion e2e/uiUserProfile.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ test("user can update profile and avatar, and navigate between pages", async ({
const chosenAvatar = page.locator("button.avatar-option").first();

await test.step("user edits name, description and avatar", async () => {
await page.goto("profile");
await page.goto("#/profile");

// The edit form is only shown in the "Edit profile" tab
await editProfileTab.click();
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import { BrowserRouter } from "react-router-dom";
import { HashRouter } from "react-router-dom";
import "./index.css";
import "./i18n";
import App from "./App.tsx";
Expand All @@ -17,9 +17,9 @@ createRoot(document.getElementById("root")!).render(
<StrictMode>
<ApolloProvider client={clienten}>
<UserProvider>
<BrowserRouter basename={import.meta.env.BASE_URL}>
<HashRouter>
<App />
</BrowserRouter>
</HashRouter>
</UserProvider>
</ApolloProvider>
</StrictMode>,
Expand Down
Loading