mirror of
https://github.com/vercel/commerce.git
synced 2025-05-20 00:16:59 +00:00
Removes data-testid
's (#1100)
This commit is contained in:
parent
3db8ad4074
commit
574e7eea9e
@ -39,11 +39,11 @@ export default function CartModal({ cart }: { cart: Cart | undefined }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<button aria-label="Open cart" onClick={openCart} data-testid="open-cart">
|
<button aria-label="Open cart" onClick={openCart}>
|
||||||
<OpenCart quantity={cart?.totalQuantity} />
|
<OpenCart quantity={cart?.totalQuantity} />
|
||||||
</button>
|
</button>
|
||||||
<Transition show={isOpen}>
|
<Transition show={isOpen}>
|
||||||
<Dialog onClose={closeCart} className="relative z-50" data-testid="cart">
|
<Dialog onClose={closeCart} className="relative z-50">
|
||||||
<Transition.Child
|
<Transition.Child
|
||||||
as={Fragment}
|
as={Fragment}
|
||||||
enter="transition-all ease-in-out duration-300"
|
enter="transition-all ease-in-out duration-300"
|
||||||
@ -68,7 +68,7 @@ export default function CartModal({ cart }: { cart: Cart | undefined }) {
|
|||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<p className="text-lg font-semibold">My Cart</p>
|
<p className="text-lg font-semibold">My Cart</p>
|
||||||
|
|
||||||
<button aria-label="Close cart" onClick={closeCart} data-testid="close-cart">
|
<button aria-label="Close cart" onClick={closeCart}>
|
||||||
<CloseCart />
|
<CloseCart />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@ -98,7 +98,6 @@ export default function CartModal({ cart }: { cart: Cart | undefined }) {
|
|||||||
return (
|
return (
|
||||||
<li
|
<li
|
||||||
key={i}
|
key={i}
|
||||||
data-testid="cart-item"
|
|
||||||
className="flex w-full flex-col border-b border-neutral-300 dark:border-neutral-700"
|
className="flex w-full flex-col border-b border-neutral-300 dark:border-neutral-700"
|
||||||
>
|
>
|
||||||
<div className="relative flex w-full flex-row justify-between px-1 py-4">
|
<div className="relative flex w-full flex-row justify-between px-1 py-4">
|
||||||
@ -128,10 +127,7 @@ export default function CartModal({ cart }: { cart: Cart | undefined }) {
|
|||||||
{item.merchandise.product.title}
|
{item.merchandise.product.title}
|
||||||
</span>
|
</span>
|
||||||
{item.merchandise.title !== DEFAULT_OPTION ? (
|
{item.merchandise.title !== DEFAULT_OPTION ? (
|
||||||
<p
|
<p className="text-sm text-neutral-800">
|
||||||
className="text-sm text-neutral-800"
|
|
||||||
data-testid="cart-product-variant"
|
|
||||||
>
|
|
||||||
{item.merchandise.title}
|
{item.merchandise.title}
|
||||||
</p>
|
</p>
|
||||||
) : null}
|
) : null}
|
||||||
|
@ -38,10 +38,7 @@ export async function ThreeItemGrid() {
|
|||||||
const [firstProduct, secondProduct, thirdProduct] = homepageItems;
|
const [firstProduct, secondProduct, thirdProduct] = homepageItems;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section
|
<section className="mx-auto max-w-screen-2xl p-2 lg:grid lg:grid-cols-6 lg:grid-rows-2">
|
||||||
className="mx-auto max-w-screen-2xl p-2 lg:grid lg:grid-cols-6 lg:grid-rows-2"
|
|
||||||
data-testid="homepage-products"
|
|
||||||
>
|
|
||||||
<ThreeItemGridItem size="full" item={firstProduct} />
|
<ThreeItemGridItem size="full" item={firstProduct} />
|
||||||
<ThreeItemGridItem size="half" item={secondProduct} />
|
<ThreeItemGridItem size="half" item={secondProduct} />
|
||||||
<ThreeItemGridItem size="half" item={thirdProduct} />
|
<ThreeItemGridItem size="half" item={thirdProduct} />
|
||||||
|
@ -19,9 +19,7 @@ const Label = ({
|
|||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
<div className="flex items-center rounded-full border bg-white/70 p-1 text-[10px] font-semibold text-black backdrop-blur-md @[275px]/label:text-xs dark:border-neutral-800 dark:bg-black/70 dark:text-white">
|
<div className="flex items-center rounded-full border bg-white/70 p-1 text-[10px] font-semibold text-black backdrop-blur-md @[275px]/label:text-xs dark:border-neutral-800 dark:bg-black/70 dark:text-white">
|
||||||
<h3 data-testid="product-name" className="mr-4 inline pl-2 leading-none tracking-tight">
|
<h3 className="mr-4 inline pl-2 leading-none tracking-tight">{title}</h3>
|
||||||
{title}
|
|
||||||
</h3>
|
|
||||||
<Price
|
<Price
|
||||||
className="flex-none rounded-full bg-blue-600 p-2 text-white"
|
className="flex-none rounded-full bg-blue-600 p-2 text-white"
|
||||||
amount={amount}
|
amount={amount}
|
||||||
|
@ -32,12 +32,7 @@ export default function MobileMenu({ menu }: { menu: Menu[] }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<button
|
<button onClick={openMobileMenu} aria-label="Open mobile menu" className="md:hidden">
|
||||||
onClick={openMobileMenu}
|
|
||||||
aria-label="Open mobile menu"
|
|
||||||
className="md:hidden"
|
|
||||||
data-testid="open-mobile-menu"
|
|
||||||
>
|
|
||||||
<Bars3Icon className="h-6" />
|
<Bars3Icon className="h-6" />
|
||||||
</button>
|
</button>
|
||||||
<Transition show={isOpen}>
|
<Transition show={isOpen}>
|
||||||
@ -64,12 +59,7 @@ export default function MobileMenu({ menu }: { menu: Menu[] }) {
|
|||||||
>
|
>
|
||||||
<Dialog.Panel className="fixed bottom-0 left-0 right-0 top-0 flex h-full w-full flex-col bg-white pb-6 dark:bg-black">
|
<Dialog.Panel className="fixed bottom-0 left-0 right-0 top-0 flex h-full w-full flex-col bg-white pb-6 dark:bg-black">
|
||||||
<div className="p-4">
|
<div className="p-4">
|
||||||
<button
|
<button className="mb-4" onClick={closeMobileMenu} aria-label="Close mobile menu">
|
||||||
className="mb-4"
|
|
||||||
onClick={closeMobileMenu}
|
|
||||||
aria-label="Close mobile menu"
|
|
||||||
data-testid="close-mobile-menu"
|
|
||||||
>
|
|
||||||
<XMarkIcon className="h-6" />
|
<XMarkIcon className="h-6" />
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
@ -123,7 +123,6 @@ export function VariantSelector({
|
|||||||
!isAvailableForSale
|
!isAvailableForSale
|
||||||
}
|
}
|
||||||
)}
|
)}
|
||||||
data-testid={isActive ? 'selected-variant' : 'variant'}
|
|
||||||
>
|
>
|
||||||
{value}
|
{value}
|
||||||
</DynamicTag>
|
</DynamicTag>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user