From 5132848dcca9ac6751b6f2d5d8252f2b9373cf58 Mon Sep 17 00:00:00 2001 From: jkindly Date: Tue, 25 Jun 2024 14:47:51 +0200 Subject: [PATCH] OP-321: Behat fix and homepage render fix --- features/admin/adding_block.feature | 4 +--- features/admin/managing_blocks.feature | 2 +- src/Entity/Block.php | 7 +++++++ src/Entity/BlockInterface.php | 3 ++- tests/Behat/Context/Setup/BlockContext.php | 2 +- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/features/admin/adding_block.feature b/features/admin/adding_block.feature index b133db9c3..93aa26346 100644 --- a/features/admin/adding_block.feature +++ b/features/admin/adding_block.feature @@ -12,7 +12,6 @@ Feature: Adding blocks Scenario: Adding block When I go to the create block page And I fill the code with "store_description" - And I fill the content with "

We have the best candies on the internet!

" And I add it Then I should be notified that the block has been created @@ -22,7 +21,6 @@ Feature: Adding blocks When I go to the create block page And I fill the code with "intro" And I add "Blog" and "Homepage" collections to it - And I fill the content with "Hello world!" And I add it Then I should be notified that the block has been created @@ -43,7 +41,7 @@ Feature: Adding blocks @ui Scenario: Trying to add block with too long data When I go to the create block page - And I fill "Code, Name, Content" fields with 251 characters + And I fill "Code, Name" fields with 251 characters And I try to add it Then I should be notified that "Code, Name" fields are too long diff --git a/features/admin/managing_blocks.feature b/features/admin/managing_blocks.feature index 22c4b0a44..c08e7eac4 100644 --- a/features/admin/managing_blocks.feature +++ b/features/admin/managing_blocks.feature @@ -18,7 +18,7 @@ Feature: Managing cms blocks @ui @javascript Scenario: Updating block - Given there is a block with "store_phone_number" code and "123456789" content + Given there is a block with "store_phone_number" code When I go to the update "store_phone_number" block page And I fill the content with "987654321" And I update it diff --git a/src/Entity/Block.php b/src/Entity/Block.php index d03f63024..0ed71c181 100755 --- a/src/Entity/Block.php +++ b/src/Entity/Block.php @@ -58,4 +58,11 @@ public function setName(?string $name): void { $this->name = $name; } + + public function getContent(): ?string + { + // TODO: empty for now for testing purposes, to be implemented in the future tasks + // related to the epic: https://bitbag.atlassian.net/browse/OP-312 + return ''; + } } diff --git a/src/Entity/BlockInterface.php b/src/Entity/BlockInterface.php index 562cc76bb..7401581f0 100755 --- a/src/Entity/BlockInterface.php +++ b/src/Entity/BlockInterface.php @@ -20,7 +20,8 @@ interface BlockInterface extends CollectionableInterface, ChannelsAwareInterface, BlockContentAwareInterface, - LocaleAwareInterface + LocaleAwareInterface, + ContentableInterface { public function getCode(): ?string; diff --git a/tests/Behat/Context/Setup/BlockContext.php b/tests/Behat/Context/Setup/BlockContext.php index f351f9bd8..29885340c 100755 --- a/tests/Behat/Context/Setup/BlockContext.php +++ b/tests/Behat/Context/Setup/BlockContext.php @@ -50,7 +50,7 @@ public function thereIsABlockWithCode(string $code): void } /** - * @Given there is a block with :code code and :content content + * @Given there is a block with :code code */ public function thereIsABlockWithCodeAndContent(string $code): void {