Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add testing framework #84

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions app/components/AddToCartButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export function AddToCartButton({
width={width}
variant={variant}
className={className}
data-shopify-product-add-to-cart
disabled={disabled ?? fetcher.state !== 'idle'}
{...props}
>
Expand Down
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
Loading