-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from coinbase/alissa.crane/bun
chore: upgrade onchainkit version
- Loading branch information
Showing
16 changed files
with
83 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export function Banner() { | ||
return ( | ||
<div className="fixed top-0 left-0 flex h-14 xs:h-12 w-full flex-wrap items-center justify-center bg-black text-white"> | ||
<div className="flex h-full flex-wrap items-center justify-center text-center text-sm xs:text-lg"> | ||
This is a demo site. These products are not for sale. | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { render, screen } from '@testing-library/react'; | ||
import { describe, expect, it, vi } from 'vitest'; | ||
import OnchainStoreItem from './OnchainStoreItem'; | ||
|
||
const mockProduct = { | ||
id: '1', | ||
name: 'Sample Product', | ||
price: 19.99, | ||
image: 'https://example.com/image.jpg', | ||
}; | ||
|
||
vi.mock('./QuantityInput', () => { | ||
return { | ||
default: ({ productId }: { productId: string }) => ( | ||
<input data-testid={`quantity-input-${productId}`} /> | ||
), | ||
}; | ||
}); | ||
|
||
vi.mock('next/image', () => { | ||
return { | ||
default: ({ | ||
src, | ||
alt, | ||
width, | ||
height, | ||
}: { | ||
src: string; | ||
alt: string; | ||
width: number; | ||
height: number; | ||
}) => <img src={src} alt={alt} width={width} height={height} />, | ||
}; | ||
}); | ||
|
||
describe('OnchainStoreItem', () => { | ||
it('should render product information correctly', () => { | ||
render(<OnchainStoreItem {...mockProduct} />); | ||
|
||
expect(screen.getByText('Sample Product')).toBeInTheDocument(); | ||
expect(screen.getByText('19.99 USDC')).toBeInTheDocument(); | ||
const imageElement = screen.getByAltText('123'); | ||
expect(imageElement).toBeInTheDocument(); | ||
expect(imageElement).toHaveAttribute('src', mockProduct.image); | ||
expect(imageElement).toHaveAttribute('width', '400'); | ||
expect(imageElement).toHaveAttribute('height', '400'); | ||
expect(screen.getByTestId('quantity-input-1')).toBeInTheDocument(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters