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 = () => (
- banner + banner

Don't miss the offer

Grab it now

diff --git a/src/components/BannerPopup.tsx b/src/components/BannerPopup.tsx index 349193f..ab49ade 100644 --- a/src/components/BannerPopup.tsx +++ b/src/components/BannerPopup.tsx @@ -1,6 +1,7 @@ import { FC } from "react"; import { useAppDispatch, useAppSelector } from "../redux/hooks"; import { updateBanner } from "../redux/features/homeSlice"; +import banner from "../assets/banner.jpg"; const BannerPopup: FC = () => { const show = useAppSelector((state) => state.homeReducer.isBannerVisible); @@ -10,13 +11,12 @@ const BannerPopup: FC = () => { return (
banner 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) => ) ) : (
- empty + empty

Your cart is empty

)} diff --git a/src/components/HeroSection.tsx b/src/components/HeroSection.tsx index 950518e..d2c389e 100644 --- a/src/components/HeroSection.tsx +++ b/src/components/HeroSection.tsx @@ -1,5 +1,6 @@ import { FC } from "react"; import { Link } from "react-router-dom"; +import hero from "../assets/hero.png"; const HeroSection: FC = () => { return ( @@ -27,7 +28,7 @@ const HeroSection: FC = () => {
- hero + hero
diff --git a/src/main.tsx b/src/main.tsx index 3b384e9..39379ca 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -6,7 +6,7 @@ import { BrowserRouter } from "react-router-dom"; ReactDOM.createRoot(document.getElementById("root")!).render( - + diff --git a/src/pages/Wishlist.tsx b/src/pages/Wishlist.tsx index 29b16ad..1b65275 100644 --- a/src/pages/Wishlist.tsx +++ b/src/pages/Wishlist.tsx @@ -1,6 +1,7 @@ import { FC } from "react"; import { useAppSelector } from "../redux/hooks"; import ProductList from "../components/ProductList"; +import emptyCart from "../assets/emptyCart.jpg"; const Wishlist: FC = () => { const wishlist = useAppSelector((state) => state.productReducer.wishlist); @@ -10,7 +11,7 @@ const Wishlist: FC = () => { ) : (
- empty + 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/", })