Skip to content

Commit

Permalink
fixup! fixup! test(Image): test for Image added
Browse files Browse the repository at this point in the history
  • Loading branch information
niktverd committed Sep 21, 2023
1 parent 4364ab5 commit 956651a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/components/Image/Image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface ImageProps extends Partial<ImageObjectProps>, Partial<ImageDevi
export interface DeviceSpecificFragmentProps extends QAProps {
disableWebp: boolean;
src: string;
breakpoint: 'md' | 'sm';
breakpoint: string;
}

const checkWebP = (src: string) => {
Expand All @@ -37,11 +37,11 @@ const DeviceSpecificFragment = ({
<source
srcSet={checkWebP(src)}
type="image/webp"
media={`(max-width: ${BREAKPOINTS[breakpoint]}px)`}
media={`(max-width: ${breakpoint})`}
data-qa={`${qa}-compressed`}
/>
)}
<source srcSet={src} media={`(max-width: ${BREAKPOINTS[breakpoint]}px)`} data-qa={qa} />
<source srcSet={src} media={`(max-width: ${breakpoint})`} data-qa={qa} />
</Fragment>
);

Expand Down Expand Up @@ -89,15 +89,15 @@ const Image = (props: ImageProps) => {
<DeviceSpecificFragment
src={mobile}
disableWebp={disableWebp}
breakpoint="sm"
breakpoint={`${BREAKPOINTS.sm} px)`}
qa={qaAttributes.mobileSource}
/>
)}
{tablet && (
<DeviceSpecificFragment
src={tablet}
disableWebp={disableWebp}
breakpoint="md"
breakpoint={`${BREAKPOINTS.md} px)`}
qa={qaAttributes.tabletSource}
/>
)}
Expand Down

0 comments on commit 956651a

Please sign in to comment.