Skip to content

Commit

Permalink
Add testing framework
Browse files Browse the repository at this point in the history
  • Loading branch information
blittle committed Dec 11, 2024
1 parent 35965f4 commit be0cd67
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/components/Cart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ function CartCheckoutActions({checkoutUrl}: {checkoutUrl: string}) {

return (
<div className="flex flex-col mt-2">
<a href={checkoutUrl} target="_self">
<a data-shopify-cart-checkout-link href={checkoutUrl} target="_self">
<Button as="span" width="full">
Continue to Checkout
</Button>
Expand Down
6 changes: 5 additions & 1 deletion app/components/FeaturedCollections.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ export function FeaturedCollections({
<Grid items={collectionsWithImage.length}>
{collectionsWithImage.map((collection) => {
return (
<Link key={collection.id} to={`/collections/${collection.handle}`}>
<Link
data-shopify-collection-link
key={collection.id}
to={`/collections/${collection.handle}`}
>
<div className="grid gap-4">
<div className="card-image bg-primary/5 aspect-[3/2]">
{collection?.image && (
Expand Down
6 changes: 5 additions & 1 deletion app/components/Hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ export function Hero({
top,
}: HeroProps) {
return (
<Link to={`/collections/${handle}`} prefetch="viewport">
<Link
data-shopify-collection-link
to={`/collections/${handle}`}
prefetch="viewport"
>
<section
className={clsx(
'relative justify-end flex flex-col w-full',
Expand Down
2 changes: 2 additions & 0 deletions app/components/PageLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -393,13 +393,15 @@ function Badge({
return isHydrated ? (
<button
onClick={openCart}
data-shopify-cart-link
className="relative flex items-center justify-center w-8 h-8 focus:ring-primary/5"
>
{BadgeCounter}
</button>
) : (
<Link
to="/cart"
data-shopify-cart-link
className="relative flex items-center justify-center w-8 h-8 focus:ring-primary/5"
>
{BadgeCounter}
Expand Down
2 changes: 2 additions & 0 deletions app/components/ProductCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export function ProductCard({
return (
<div className="flex flex-col gap-2">
<Link
data-shopify-product-link
onClick={onClick}
to={`/products/${product.handle}`}
prefetch="viewport"
Expand Down Expand Up @@ -95,6 +96,7 @@ export function ProductCard({
</Link>
{quickAdd && firstVariant.availableForSale && (
<AddToCartButton
data-shopify-product-add-to-cart
lines={[
{
quantity: 1,
Expand Down
1 change: 1 addition & 0 deletions app/routes/($locale).collections._index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ function CollectionCard({
return (
<Link
prefetch="viewport"
data-shopify-collection-link
to={`/collections/${collection.handle}`}
className="grid gap-4"
>
Expand Down

0 comments on commit be0cd67

Please sign in to comment.