Skip to content

Commit

Permalink
OP-321: Behat fix and homepage render fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jkindly committed Jun 25, 2024
1 parent ae6f00a commit 5132848
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
4 changes: 1 addition & 3 deletions features/admin/adding_block.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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 "<p>We have the best candies on the internet!</p>"
And I add it
Then I should be notified that the block has been created

Expand All @@ -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

Expand All @@ -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

2 changes: 1 addition & 1 deletion features/admin/managing_blocks.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions src/Entity/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 '';
}
}
3 changes: 2 additions & 1 deletion src/Entity/BlockInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ interface BlockInterface extends
CollectionableInterface,
ChannelsAwareInterface,
BlockContentAwareInterface,
LocaleAwareInterface
LocaleAwareInterface,
ContentableInterface
{
public function getCode(): ?string;

Expand Down
2 changes: 1 addition & 1 deletion tests/Behat/Context/Setup/BlockContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down

0 comments on commit 5132848

Please sign in to comment.