|
import { openGraph } from '@/lib/helper'; |
|
|
|
describe('Open Graph function should work correctly', () => { |
|
it('should not return templateTitle when not specified', () => { |
|
const result = openGraph({ |
|
description: 'Test description', |
|
siteName: 'Test site name', |
|
}); |
|
expect(result).not.toContain('&templateTitle='); |
|
}); |
|
|
|
it('should return templateTitle when specified', () => { |
|
const result = openGraph({ |
|
templateTitle: 'Test Template Title', |
|
description: 'Test description', |
|
siteName: 'Test site name', |
|
}); |
|
expect(result).toContain('&templateTitle=Test%20Template%20Title'); |
|
}); |
|
}); |
|
|