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

Thunk support

This commit is contained in:
Samuel Štancl 2021-05-24 18:24:10 +02:00
parent 04cfab679c
commit 084736672e
2 changed files with 18 additions and 5 deletions

View file

@ -66,3 +66,15 @@ test('magic access gets converted to dot syntax', function () {
expect(seo('abc.def'))->toBe('xyz');
expect(seo()->abcDef)->toBe('xyz');
});
test('thunks can be used as values', function () {
seo()->title(fn () => 'bar');
expect(seo('title'))->toBe('bar');
});
test('thunks can be used as deafults', function () {
seo()->title(default: fn () => 'bar');
expect(seo('title'))->toBe('bar');
});