Skip to content

Commit 87d5bbe

Browse files
authoredFeb 17, 2025··
Change inner paragraph in InfoCard to div (#2040)
1 parent 97b74b6 commit 87d5bbe

File tree

7 files changed

+25
-6
lines changed

7 files changed

+25
-6
lines changed
 

‎.changeset/rich-socks-decide.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@theguild/components": patch
3+
---
4+
5+
Change inner paragraph in InfoCard to div

‎packages/components/src/components/info-card.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function InfoCard({
2020
<Root className={cn('bg-beige-100 p-6 md:p-12', className)} {...rest}>
2121
<Stud>{icon}</Stud>
2222
<h3 className="mt-4 text-xl font-medium leading-[1.4] text-green-1000 md:mt-6">{heading}</h3>
23-
<p className="mt-2 text-green-800 md:mt-4">{children}</p>
23+
<div className="mt-2 space-y-2 text-green-800 md:mt-4">{children}</div>
2424
</Root>
2525
);
2626
}

‎packages/og-image/global.d.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
import { toMatchImageSnapshot } from 'jest-image-snapshot';
2+
13
declare global {
24
namespace jest {
35
interface Matchers<R> {
4-
toMatchImageSnapshot(): R;
6+
toMatchImageSnapshot(options?: Parameters<typeof toMatchImageSnapshot>[0]): R;
57
}
68
}
79
}

‎packages/og-image/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"deploy": "wrangler publish",
77
"postinstall": "tsx ../../scripts/copy-wasm.ts",
88
"start": "NODE_ENV=development wrangler dev",
9+
"test": "pnpm -w test packages/og-image",
910
"types:check": "tsc --noEmit"
1011
},
1112
"dependencies": {
Loading

‎packages/og-image/src/handler.test.ts

+15-4
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,36 @@ vi.mock('../vender/index_bg.wasm', async () => {
99
});
1010

1111
describe('handler()', () => {
12-
it('should works', async () => {
12+
it('should work', async () => {
1313
const response = await handler({
1414
url: 'http://localhost:3000?product=CONDUCTOR',
1515
} as Request);
1616
const result = Buffer.from(await response.arrayBuffer());
17-
expect(result).toMatchImageSnapshot();
17+
expect(result).toMatchImageSnapshot({
18+
failureThresholdType: 'percent',
19+
failureThreshold: 0.2,
20+
});
1821
});
22+
1923
it('should align title and have container padding', async () => {
2024
const response = await handler({
2125
url: 'http://localhost:3000?product=ESLINT&title=Hello this is a test of really really really really really really long title',
2226
} as Request);
2327
const result = Buffer.from(await response.arrayBuffer());
24-
expect(result).toMatchImageSnapshot();
28+
expect(result).toMatchImageSnapshot({
29+
failureThresholdType: 'percent',
30+
failureThreshold: 0.2,
31+
});
2532
});
33+
2634
it('should align title without whitespaces', async () => {
2735
const response = await handler({
2836
url: 'http://localhost:3000?product=FETS&title=Home',
2937
} as Request);
3038
const result = Buffer.from(await response.arrayBuffer());
31-
expect(result).toMatchImageSnapshot();
39+
expect(result).toMatchImageSnapshot({
40+
failureThresholdType: 'percent',
41+
failureThreshold: 0.2,
42+
});
3243
});
3344
});

0 commit comments

Comments
 (0)
Please sign in to comment.