diff --git a/cypress.config.ts b/cypress.config.ts index fa3a1a3..4501e59 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -2,7 +2,7 @@ import { defineConfig } from "cypress"; export default defineConfig({ e2e: { - baseUrl: "http://localhost:5173", + baseUrl: "http://localhost:5173/test-abb", // SOLUCIÓN: Resolución Full HD para que el banner no tape nada viewportWidth: 1920, viewportHeight: 1080, diff --git a/cypress/e2e/navbar.cy.ts b/cypress/e2e/navbar.cy.ts index f7be7ee..5039209 100644 --- a/cypress/e2e/navbar.cy.ts +++ b/cypress/e2e/navbar.cy.ts @@ -5,17 +5,18 @@ describe("testing navbar functions", () => { it("clicking on products works properly", () => { cy.get('[data-test="main-products"]').click({ force: true }); - cy.location("pathname").should("equal", "/products"); + cy.location("pathname").should("contain", "/products"); }); it("clicking on products works properly", () => { cy.get('[data-test="main-logo"]').click({ force: true }); - cy.location("pathname").should("equal", "/"); + // Verify it goes back to root (which is /test-abb/) + cy.location("pathname").should("match", /\/test-abb\/?$/); }); it.skip("clicking on a product works properly", () => { cy.get('[data-test="product-card"]').first().click({ force: true }); - cy.location("pathname").should("equal", "/product/1"); + cy.location("pathname").should("contain", "/product/1"); }); it("login & logout works properly", () => { diff --git a/public/banner.jpg b/src/assets/banner.jpg similarity index 100% rename from public/banner.jpg rename to src/assets/banner.jpg diff --git a/public/emptyCart.jpg b/src/assets/emptyCart.jpg similarity index 100% rename from public/emptyCart.jpg rename to src/assets/emptyCart.jpg diff --git a/public/hero.png b/src/assets/hero.png similarity index 100% rename from public/hero.png rename to src/assets/hero.png diff --git a/src/components/Banner.tsx b/src/components/Banner.tsx index 5c6c58a..e6f6d86 100644 --- a/src/components/Banner.tsx +++ b/src/components/Banner.tsx @@ -1,9 +1,11 @@ import { FC } from "react"; import { Link } from "react-router-dom"; +import banner from "../assets/banner.jpg"; + const Banner: FC = () => (
+
diff --git a/src/components/Cart.tsx b/src/components/Cart.tsx
index 2b22c7e..b112944 100644
--- a/src/components/Cart.tsx
+++ b/src/components/Cart.tsx
@@ -4,6 +4,7 @@ import { useAppDispatch, useAppSelector } from "../redux/hooks";
import { emptyCart, setCartState } from "../redux/features/cartSlice";
import CartRow from "./CartRow";
import toast from "react-hot-toast";
+import emptyCartImg from "../assets/emptyCart.jpg";
const Cart: FC = () => {
const dispatch = useAppDispatch();
@@ -78,7 +79,7 @@ const Cart: FC = () => {
items.map((item) =>
+ Your cart is empty
+
+ Your wishlist is empty
diff --git a/vite.config.ts b/vite.config.ts index 5a33944..9780006 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -4,4 +4,5 @@ import react from '@vitejs/plugin-react' // https://vitejs.dev/config/ export default defineConfig({ plugins: [react()], + base: "/test-abb/", })