1
0
Fork 0
mirror of https://github.com/archtechx/laravel-seo.git synced 2025-12-12 01:44:03 +00:00

OpenGraph improvements (#17)

* Allow setting tag('og:title', ...)

* og:type overriding

* Add type()
This commit is contained in:
Samuel Štancl 2022-03-30 18:01:21 +02:00 committed by GitHub
parent 2480e532bf
commit 754b3936d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 50 additions and 5 deletions

View file

@ -127,3 +127,22 @@ test('canonical url can be changed', function () {
->toContain('<meta property="og:url" content="http://foo.com/bar" />')
->toContain('<link rel="canonical" href="http://foo.com/bar" />');
});
test('og:title can be overridden using a tag', function () {
seo()->title('foo')
->tag('og:title', 'bar');
expect(meta())
->toContain('<title>foo</title>')
->toContain('<meta property="og:title" content="bar" />');
});
test('type can be overridden using the type method', function () {
expect(meta())->toContain('<meta property="og:type" content="website" />'); // default
seo()->type('foo');
expect(meta())
->toContain('<meta property="og:type" content="foo" />') // overridden
->not()->toContain('website');
});