Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions lib/seo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,6 @@ export function generateServiceSchema(
'@type': 'GeoShape',
name: 'Worldwide',
},
serviceOutput: {
'@type': 'Product',
name: `${serviceName} deliverables`,
},
hasOfferCatalog: config?.offers
? {
'@type': 'OfferCatalog',
Expand Down
41 changes: 41 additions & 0 deletions tests/lib/seo.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { describe, expect, it } from 'vitest';
import { generateServiceSchema } from '@/lib/seo';

describe('generateServiceSchema', () => {
it('does not emit Product structured data for service pages', () => {
const schema = generateServiceSchema('Shopify Development', 'Custom Shopify development', {
url: '/solutions/shopify',
locale: 'en',
});

expect(schema['@type']).toBe('Service');
expect(schema).not.toHaveProperty('serviceOutput');
expect(JSON.stringify(schema)).not.toContain('"@type":"Product"');
});

it('keeps service package offers inside an OfferCatalog without Product markup', () => {
const schema = generateServiceSchema('SEO Services', 'SEO consulting and implementation', {
url: '/solutions/seo',
locale: 'en',
offers: [
{
name: 'SEO Audit',
description: 'A technical and content audit',
price: '500',
},
],
});

expect(schema.hasOfferCatalog).toMatchObject({
'@type': 'OfferCatalog',
itemListElement: [
expect.objectContaining({
'@type': 'Offer',
price: '500',
priceCurrency: 'USD',
}),
],
});
expect(JSON.stringify(schema)).not.toContain('"@type":"Product"');
});
});
Loading