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
2 changes: 1 addition & 1 deletion backend/src/resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const users = db.collection<UserDoc>("users");

const toPlant = (doc: WithId<PlantDoc>): Plant => ({
id: doc._id.toString(),
name: doc.commonName,
name: doc.commonName.replace(/\*/g, "").replace(/\s+/g, " ").trim(),
imageURL: doc.imageData ?? doc.imageURL ?? null,
scientificName: doc.scientificName,
description: doc.description,
Expand Down
6 changes: 2 additions & 4 deletions e2e/uiAccessibility.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,8 @@ test.describe("after interaction", () => {
test("ExplorePlants with a plant card flipped", async ({ page }) => {
await page.goto("#/explorePlants");
const firstCard = page.locator(".plant-grid > li").first();
await firstCard
.locator(".plant-card-front .plant-card-info-button")
.click();
await expect(firstCard.locator(".plant-card-back")).toHaveAttribute(
await firstCard.locator(".plant-card-front .plant-card-hint").click();
await expect(firstCard.locator(".plant-card-face-back")).toHaveAttribute(
"aria-hidden",
"false",
);
Expand Down
6 changes: 3 additions & 3 deletions e2e/uiExplorePlants.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ test("user pages, filters, searches, opens a plant, sorts and resets", async ({

await test.step("opening a plant shows its details", async () => {
const jadeCard = cards.nth(0);
const details = jadeCard.locator(".plant-card-back");
const details = jadeCard.locator(".plant-card-face-back");

await jadeCard.locator(".plant-card-front .plant-card-info-button").click();
await jadeCard.locator(".plant-card-front .plant-card-hint").click();
await expect(details).toHaveAttribute("aria-hidden", "false");
await expect(details).toContainText("Crassula ovata");
await expect(details).toContainText("Low");
Expand All @@ -61,7 +61,7 @@ test("user pages, filters, searches, opens a plant, sorts and resets", async ({
);

// Flip the card back so the next steps see the front again
await details.locator(".plant-card-info-button").click();
await details.locator(".plant-card-hint").click();
await expect(details).toHaveAttribute("aria-hidden", "true");
});

Expand Down
Loading
Loading