34 lines
1.1 KiB
PHP
34 lines
1.1 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
declare(strict_types=1);
|
||
|
|
|
||
|
|
use App\Support\PostPlatformMetaRules;
|
||
|
|
|
||
|
|
test('custom meta messages only cover pinterest title and link', function () {
|
||
|
|
expect(PostPlatformMetaRules::messages())->toBe([
|
||
|
|
'platforms.*.meta.link.url' => __('posts.form.pinterest.link_invalid'),
|
||
|
|
'platforms.*.meta.link.max' => __('posts.form.pinterest.link_max'),
|
||
|
|
'platforms.*.meta.title.max' => __('posts.form.pinterest.title_max'),
|
||
|
|
]);
|
||
|
|
});
|
||
|
|
|
||
|
|
test('custom meta attributes only rename pinterest title and link', function () {
|
||
|
|
expect(PostPlatformMetaRules::attributes())->toBe([
|
||
|
|
'platforms.*.meta.title' => __('posts.form.pinterest.title'),
|
||
|
|
'platforms.*.meta.link' => __('posts.form.pinterest.link'),
|
||
|
|
]);
|
||
|
|
});
|
||
|
|
|
||
|
|
test('shared meta rules still include non-pinterest platform fields', function () {
|
||
|
|
$rules = PostPlatformMetaRules::rules();
|
||
|
|
|
||
|
|
expect($rules)->toHaveKeys([
|
||
|
|
'platforms.*.meta.aspect_ratio',
|
||
|
|
'platforms.*.meta.privacy_level',
|
||
|
|
'platforms.*.meta.board_id',
|
||
|
|
'platforms.*.meta.channel_id',
|
||
|
|
'platforms.*.meta.title',
|
||
|
|
'platforms.*.meta.link',
|
||
|
|
]);
|
||
|
|
});
|