fix(blog): restore TOC, list styling, and dynamic OG images
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 13s
Build & Deploy / 🧪 QA (push) Successful in 2m51s
Build & Deploy / 🏗️ Build (push) Successful in 5m32s
Build & Deploy / 🚀 Deploy (push) Successful in 16s
Build & Deploy / 🔔 Notify (push) Successful in 1s
Build & Deploy / 🧪 Post-Deploy Verification (push) Failing after 5m12s
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 13s
Build & Deploy / 🧪 QA (push) Successful in 2m51s
Build & Deploy / 🏗️ Build (push) Successful in 5m32s
Build & Deploy / 🚀 Deploy (push) Successful in 16s
Build & Deploy / 🔔 Notify (push) Successful in 1s
Build & Deploy / 🧪 Post-Deploy Verification (push) Failing after 5m12s
This commit reapplies fixes directly to main after reverting an accidental feature branch merge. chore(release): bump version to 2.2.6
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { describe, it, expect, beforeAll } from 'vitest';
|
||||
|
||||
const BASE_URL = process.env.TEST_URL || process.env.NEXT_PUBLIC_BASE_URL || 'http://localhost:3000';
|
||||
const BASE_URL =
|
||||
process.env.TEST_URL || process.env.NEXT_PUBLIC_BASE_URL || 'http://localhost:3000';
|
||||
|
||||
describe('OG Image Generation', () => {
|
||||
const locales = ['de', 'en'];
|
||||
@@ -18,7 +19,9 @@ describe('OG Image Generation', () => {
|
||||
return;
|
||||
}
|
||||
}
|
||||
console.log(`\n⚠️ KLZ Application not detected at ${BASE_URL}. Skipping integration tests.\n`);
|
||||
console.log(
|
||||
`\n⚠️ KLZ Application not detected at ${BASE_URL}. Skipping integration tests.\n`,
|
||||
);
|
||||
} catch (e) {
|
||||
isServerUp = false;
|
||||
}
|
||||
@@ -34,7 +37,7 @@ describe('OG Image Generation', () => {
|
||||
// Check for PNG signature: 89 50 4E 47 0D 0A 1A 0A
|
||||
expect(bytes[0]).toBe(0x89);
|
||||
expect(bytes[1]).toBe(0x50);
|
||||
expect(bytes[2]).toBe(0x4E);
|
||||
expect(bytes[2]).toBe(0x4e);
|
||||
expect(bytes[3]).toBe(0x47);
|
||||
|
||||
// Check that the image is not empty and has a reasonable size
|
||||
@@ -49,7 +52,9 @@ describe('OG Image Generation', () => {
|
||||
await verifyImageResponse(response);
|
||||
}, 30000);
|
||||
|
||||
it(`should generate product OG image for ${locale} with slug ${productSlugs[0]}`, async ({ skip }) => {
|
||||
it(`should generate product OG image for ${locale} with slug ${productSlugs[0]}`, async ({
|
||||
skip,
|
||||
}) => {
|
||||
if (!isServerUp) skip();
|
||||
const url = `${BASE_URL}/${locale}/api/og/product?slug=${productSlugs[0]}`;
|
||||
const response = await fetch(url);
|
||||
@@ -64,11 +69,26 @@ describe('OG Image Generation', () => {
|
||||
}, 30000);
|
||||
});
|
||||
|
||||
it('should generate blog OG image', async ({ skip }) => {
|
||||
it('should generate static blog overview OG image', async ({ skip }) => {
|
||||
if (!isServerUp) skip();
|
||||
const url = `${BASE_URL}/de/blog/opengraph-image`;
|
||||
const response = await fetch(url);
|
||||
await verifyImageResponse(response);
|
||||
}, 30000);
|
||||
});
|
||||
|
||||
it('should generate dynamic blog post OG image', async ({ skip }) => {
|
||||
if (!isServerUp) skip();
|
||||
// Assuming 'hello-world' or a newly created post slug.
|
||||
// If it 404s, it still tests the routing, though 200 is expected for an actual post.
|
||||
const url = `${BASE_URL}/de/blog/hello-world/opengraph-image`;
|
||||
const response = await fetch(url);
|
||||
// Even if the post "hello-world" doesn't exist and returns 404 in some environments,
|
||||
// we should at least check it doesn't 500. We'll accept 200 or 404 as valid "working" states
|
||||
// vs a 500 compilation/satori error.
|
||||
expect([200, 404]).toContain(response.status);
|
||||
|
||||
if (response.status === 200) {
|
||||
await verifyImageResponse(response);
|
||||
}
|
||||
}, 30000);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user