Skip to content

Commit

Permalink
OP-326: Behat - deleting content element
Browse files Browse the repository at this point in the history
  • Loading branch information
jkindly committed Jul 10, 2024
1 parent f14c55a commit bfee78a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions features/admin/managing_blocks.feature
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Feature: Managing cms blocks
Scenario: Deleting content element in block
Given there is a block with "store_phone_number" code and "Textarea" content element
When I go to the update "store_phone_number" block page
And I fill the name with "Store phone number" if the name field is empty
And I delete the content element
And I update it
Then I should be notified that the block has been successfully updated
Expand Down
2 changes: 2 additions & 0 deletions tests/Behat/Context/Setup/BlockContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Behat\Behat\Context\Context;
use BitBag\SyliusCmsPlugin\Entity\BlockInterface;
use BitBag\SyliusCmsPlugin\Entity\ContentConfiguration;
use BitBag\SyliusCmsPlugin\Entity\ContentConfigurationInterface;
use BitBag\SyliusCmsPlugin\Repository\BlockRepositoryInterface;
use Sylius\Behat\Service\SharedStorageInterface;
use Sylius\Component\Core\Model\ChannelInterface;
Expand Down Expand Up @@ -96,6 +97,7 @@ private function createBlockWithContentElement(string $code, string $contentElem
{
$block = $this->createBlock($code);

/** @var ContentConfigurationInterface $contentConfiguration */
$contentConfiguration = new ContentConfiguration();
$contentConfiguration->setType(mb_strtolower($contentElement));
$contentConfiguration->setConfiguration(ContentElementHelper::getExampleConfigurationByContentElement($contentElement));
Expand Down

0 comments on commit bfee78a

Please sign in to comment.