From d6020f0e8d563ce87faae55955c757eeba110784 Mon Sep 17 00:00:00 2001 From: Graham Aitken Date: Sun, 21 Jul 2024 17:11:21 +0100 Subject: [PATCH 1/3] Golf ExampleBlock test enum exampleData method --- tests/Enums/ExampleBlock.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/Enums/ExampleBlock.php b/tests/Enums/ExampleBlock.php index efd57b0..03d26e8 100644 --- a/tests/Enums/ExampleBlock.php +++ b/tests/Enums/ExampleBlock.php @@ -44,15 +44,13 @@ public function exampleData(): ?array ], ], ], - self::PRIVACY_POLICY => null, - self::SECTION_DIVIDER => null, - self::STACK => null, self::TABS => [ 'tabs' => ['Tab One', 'Tab Two'], 'tabContents' => ['

Tab one content.

', '

Tab two content.

'], ], self::WYSIWYG => ['html' => '

test

'], - default => BlockType::from($this->value)->staticData(), + self::UNKNOWN => BlockType::from($this->value)->staticData(), + default => null, }; } From aeef3ff9c733730da417efe491778450d3a46cbc Mon Sep 17 00:00:00 2001 From: Graham Aitken Date: Tue, 23 Jul 2024 23:27:29 +0100 Subject: [PATCH 2/3] Restore assertion to PrivacyPolicyContentResourceTest --- .../PrivacyPolicyContentResourceTest.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/tests/Unit/App/Http/Resources/Views/Public/Content/PrivacyPolicyContentResourceTest.php b/tests/Unit/App/Http/Resources/Views/Public/Content/PrivacyPolicyContentResourceTest.php index 557a5ad..c50591f 100644 --- a/tests/Unit/App/Http/Resources/Views/Public/Content/PrivacyPolicyContentResourceTest.php +++ b/tests/Unit/App/Http/Resources/Views/Public/Content/PrivacyPolicyContentResourceTest.php @@ -16,7 +16,24 @@ expect($actual['blocks']) ->toBeArray() - ->toHaveCount(3); + ->toHaveCount(3) + ->toMatchArray([ + [ + 'type' => 'wysiwyg', + 'data' => [ + 'html' => '

PRIVACY POLICY

+

' . config('app.name') . '

', + ], + ], + [ + 'type' => 'section-divider', + 'data' => [], + ], + [ + 'type' => 'privacy-policy', + 'data' => ['html' => view('partials.static-blocks.privacy')->render()], + ], + ]); expect($actual) ->toHaveCamelCaseKeys() From 0b4c9f4758016b6aac807e3c365c6d571ae4ef8a Mon Sep 17 00:00:00 2001 From: Graham Aitken Date: Tue, 23 Jul 2024 23:28:22 +0100 Subject: [PATCH 3/3] Remove font-family check from ToHaveCorrectHtmlHead assertions --- tests/Pest/Expectations/ToHaveCorrectHtmlHead.php | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/Pest/Expectations/ToHaveCorrectHtmlHead.php b/tests/Pest/Expectations/ToHaveCorrectHtmlHead.php index 1a3dab6..818283a 100644 --- a/tests/Pest/Expectations/ToHaveCorrectHtmlHead.php +++ b/tests/Pest/Expectations/ToHaveCorrectHtmlHead.php @@ -38,7 +38,6 @@ '', '', '', - '', '', '