@xexr/blog-platform 1.1.3 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -823,7 +823,7 @@ function ArticleCardImage({ src, alt }: { src: string; alt: string }) {
823
823
  alt={alt}
824
824
  width={480}
825
825
  height={270}
826
- className="h-full w-full object-contain"
826
+ className="h-full w-full object-cover transition-transform duration-300 group-hover:scale-105"
827
827
  />
828
828
  </div>
829
829
  );
@@ -315,7 +315,7 @@ function AuthorArticlePreview({
315
315
  }
316
316
  width={320}
317
317
  height={200}
318
- className="h-full w-full object-contain"
318
+ className="h-full w-full object-cover transition-transform duration-300 group-hover:scale-105"
319
319
  />
320
320
  </div>
321
321
  )}
@@ -79,6 +79,26 @@ describe("BlogHomePage", () => {
79
79
  expect(html).toContain("Recurring work and routines");
80
80
  });
81
81
 
82
+ it("renders article preview images as clipped cover thumbnails", async () => {
83
+ const html = await renderToHtml(
84
+ React.createElement(BlogHomePage, {
85
+ articles: [
86
+ {
87
+ ...article,
88
+ featuredImage: "https://cdn.example.com/articles/routines.webp",
89
+ featuredImageAlt: "A tidy workspace",
90
+ },
91
+ ],
92
+ }),
93
+ );
94
+
95
+ expect(html).toContain("overflow-hidden rounded-2xl");
96
+ expect(html).toContain(
97
+ "h-full w-full object-cover transition-transform duration-300 group-hover:scale-105",
98
+ );
99
+ expect(html).not.toContain("h-full w-full object-contain");
100
+ });
101
+
82
102
  it("renders the newsletter form when configured", async () => {
83
103
  const html = await renderToHtml(
84
104
  React.createElement(BlogHomePage, {
@@ -240,7 +240,7 @@ function ArticlePreview({
240
240
  }
241
241
  width={400}
242
242
  height={250}
243
- className="h-full w-full object-contain"
243
+ className="h-full w-full object-cover transition-transform duration-300 group-hover:scale-105"
244
244
  />
245
245
  </Link>
246
246
  )}
@@ -309,7 +309,7 @@ function ArticlePreview({
309
309
  }
310
310
  width={288}
311
311
  height={180}
312
- className="h-full w-full object-contain"
312
+ className="h-full w-full object-cover transition-transform duration-300 group-hover:scale-105"
313
313
  />
314
314
  </Link>
315
315
  )}
@@ -76,4 +76,26 @@ describe("Blog topic archive pages", () => {
76
76
  expect(html).toContain("via-[var(--blog-text-accent)]");
77
77
  expect(html).toContain("to-fuchsia-200");
78
78
  });
79
+
80
+ it("renders topic archive article images as clipped cover thumbnails", () => {
81
+ const html = renderToStaticMarkup(
82
+ React.createElement(BlogTopicArchivePage, {
83
+ articles: [
84
+ {
85
+ ...article,
86
+ featuredImage: "https://cdn.example.com/articles/routines.webp",
87
+ featuredImageAlt: "A tidy workspace",
88
+ },
89
+ ],
90
+ topicSlug: "recurring-work-and-routines",
91
+ basePath: "/new-blog",
92
+ }),
93
+ );
94
+
95
+ expect(html).toContain("overflow-hidden rounded-2xl");
96
+ expect(html).toContain(
97
+ "h-full w-full object-cover transition-transform duration-300 group-hover:scale-105",
98
+ );
99
+ expect(html).not.toContain("h-full w-full object-contain");
100
+ });
79
101
  });
@@ -194,7 +194,7 @@ function TopicArticleCard({
194
194
  alt={article.featuredImageAlt ?? article.title}
195
195
  width={640}
196
196
  height={360}
197
- className="h-full w-full object-contain"
197
+ className="h-full w-full object-cover transition-transform duration-300 group-hover:scale-105"
198
198
  />
199
199
  </div>
200
200
  )}