Skip to content

test(F0Card): add unit test for imageAspectRatio="16/9"#3657

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/sub-pr-3652
Draft

test(F0Card): add unit test for imageAspectRatio="16/9"#3657
Copilot wants to merge 4 commits intomainfrom
copilot/sub-pr-3652

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 12, 2026

The imageAspectRatio="16/9" feature added in #3652 had no unit test coverage.

Changes

  • New test case in Card.test.tsx: renders F0Card with imageAspectRatio="16/9" and asserts:
    • Image container has aspect-video class
    • No fixed-height class from imageSizeClassMap (h-24 through h-64) is applied
it("renders image container with aspect-video class when imageAspectRatio is 16/9", () => {
  render(
    <F0Card
      title="Aspect Ratio Card"
      image="/path/to/test-image.jpg"
      imageAspectRatio="16/9"
    />
  )

  const img = screen.getByRole("img", { name: "Aspect Ratio Card" })
  const imageContainer = img.parentElement

  expect(imageContainer).toHaveClass("aspect-video")
  expect(imageContainer).not.toHaveClass("h-32") // default imageSize="sm"
  // ...all other h-* sizes also asserted absent
})

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: ekaterina-spiridonova <261384366+ekaterina-spiridonova@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot March 12, 2026 14:22
Copilot AI changed the title [WIP] [WIP] Address feedback on F0Card 16:9 image aspect ratio implementation test(F0Card): add unit test for imageAspectRatio="16/9" Mar 12, 2026
Base automatically changed from feature/f0-image-16-9 to main March 12, 2026 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants