Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ describe('isValidPartialFiatAmountInput', () => {
});

describe('PerpsFiatHeroAmountInput', () => {
it('renders the container with w-full class to ensure centering in narrow viewports', () => {
const { container } = render(
<PerpsFiatHeroAmountInput value="2.707414" onChange={jest.fn()} />,
);
const heroBox = container.firstChild as HTMLElement;
expect(heroBox.className).toContain('w-full');
});

it('renders symbol and forwards input changes', () => {
const onChange = jest.fn();
render(<PerpsFiatHeroAmountInput value="" onChange={onChange} />);
Expand All @@ -46,9 +54,9 @@ describe('PerpsFiatHeroAmountInput', () => {
<PerpsFiatHeroAmountInput value="1" onChange={jest.fn()} isLoading />,
);

expect(
screen.getByTestId('perps-fiat-hero-amount-skeleton'),
).toBeInTheDocument();
const skeleton = screen.getByTestId('perps-fiat-hero-amount-skeleton');
expect(skeleton).toBeInTheDocument();
expect(skeleton.className).toContain('w-full');
expect(
screen.queryByTestId('perps-fiat-hero-amount-input'),
).not.toBeInTheDocument();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export const PerpsFiatHeroAmountSkeleton: React.FC = () => (
flexDirection={BoxFlexDirection.Row}
justifyContent={BoxJustifyContent.Center}
alignItems={BoxAlignItems.Center}
className="w-full"
style={{ minHeight: '70px' }}
data-testid="perps-fiat-hero-amount-skeleton"
>
Expand Down Expand Up @@ -134,6 +135,7 @@ export const PerpsFiatHeroAmountInput: React.FC<PerpsFiatHeroAmountInputProps> =
flexDirection={BoxFlexDirection.Row}
justifyContent={BoxJustifyContent.Center}
alignItems={BoxAlignItems.Center}
className="w-full"
Comment thread
abretonc7s marked this conversation as resolved.
style={{ minHeight: '70px' }}
>
<Text
Expand Down
Loading