Skip to content

Commit

Permalink
Deployment issues
Browse files Browse the repository at this point in the history
  • Loading branch information
david emioma committed May 7, 2024
1 parent 745ed69 commit b38f355
Show file tree
Hide file tree
Showing 12 changed files with 164 additions and 179 deletions.
2 changes: 0 additions & 2 deletions app/(marketing)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import { Button } from "@/components/ui/button";
import SearchBar from "./_components/SearchBar";
import { getHomePageProducts } from "@/data/product";

export const revalidate = 60; //Revalidate every 60 seconds

export default async function Home() {
const { user } = await currentUser();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const ProductSlider = ({ images }: Props) => {
className="object-cover"
fill
src={img}
alt={`product-item-${i}`}
alt={`product-slider-item-${i}`}
/>
</div>
))}
Expand Down
2 changes: 0 additions & 2 deletions app/(marketing)/products/[productId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import {
checkIfReviewed,
} from "@/data/review";

export const revalidate = 60; //Revalidate every 60 seconds

export default async function ProductPage({
params: { productId },
}: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import React from "react";
import React, { useState, useEffect } from "react";
import AddBtn from "./AddBtn";
import { toast } from "sonner";
import axios, { AxiosError } from "axios";
Expand Down Expand Up @@ -48,6 +48,8 @@ const AvailableForm = ({
}: Props) => {
const params = useParams();

const [mounted, setMounted] = useState(false);

const { fields, append, remove } = useFieldArray({
control: form.control,
name: `productItems.${index}.availableItems`,
Expand Down Expand Up @@ -76,6 +78,12 @@ const AvailableForm = ({
},
});

useEffect(() => {
setMounted(true);
}, []);

if (!mounted) return null;

return (
<div className="space-y-2">
<div className="flex items-center gap-2">
Expand Down
8 changes: 1 addition & 7 deletions cypress/e2e/payment.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,9 @@ describe("Cart and payment", () => {

cy.get('[data-cy="cart-item-0"]', { timeout: 10000 }).should("be.visible");

cy.get('[data-cy="stripe-checkout-btn"]').should("not.be.disabled").click();

cy.wait(5000);

cy.window().then((win) => {
cy.stub(win, "open").as("redirect");

cy.stub(win.console, "error").as("console.error");
});
cy.get('[data-cy="stripe-checkout-btn"]').should("not.be.disabled");
});

it("Remove item from cart", () => {
Expand Down
Loading

0 comments on commit b38f355

Please sign in to comment.