-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #500 from BitBagCommerce/feature/OP-320
OP-320: Add possibility to select section type and fill up collection of items of this type
- Loading branch information
Showing
257 changed files
with
2,464 additions
and
1,739 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 16 additions & 16 deletions
32
features/admin/adding_section.feature → features/admin/adding_collection.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,45 @@ | ||
@managing_sections | ||
Feature: Adding new section | ||
@managing_collections | ||
Feature: Adding new collection | ||
In order to present more sophisticated content | ||
As an Administrator | ||
I want to be able to add new CMS sections to the store | ||
I want to be able to add new CMS collections to the store | ||
|
||
Background: | ||
Given the store operates on a single channel in "United States" | ||
And I am logged in as an administrator | ||
|
||
@ui | ||
Scenario: Adding new section | ||
When I go to the create section page | ||
Scenario: Adding new collection | ||
When I go to the create collection page | ||
And I fill the code with "blog" | ||
And I fill the name with "Blog" | ||
And I add it | ||
Then I should be notified that new section has been created | ||
Then I should be notified that new collection has been created | ||
|
||
@ui | ||
Scenario: Trying to add a section with an existing code | ||
Given there is an existing section with "blog" code | ||
When I go to the create section page | ||
Scenario: Trying to add a collection with an existing code | ||
Given there is an existing collection with "blog" code | ||
When I go to the create collection page | ||
And I fill the code with "blog" | ||
And I try to add it | ||
Then I should be notified that there is already an existing section with provided code | ||
Then I should be notified that there is already an existing collection with provided code | ||
|
||
@ui | ||
Scenario: Trying to add section with blank data | ||
When I go to the create section page | ||
Scenario: Trying to add collection with blank data | ||
When I go to the create collection page | ||
And I try to add it | ||
Then I should be notified that "Code, Name" fields cannot be blank | ||
|
||
@ui | ||
Scenario: Trying to add section with too short data | ||
When I go to the create section page | ||
Scenario: Trying to add collection with too short data | ||
When I go to the create collection page | ||
And I fill "Code, Name" fields with 1 character | ||
And I try to add it | ||
Then I should be notified that "Code, Name" fields are too short | ||
|
||
@ui | ||
Scenario: Trying to add section with too long data | ||
When I go to the create section page | ||
Scenario: Trying to add collection with too long data | ||
When I go to the create collection page | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
@managing_collections | ||
Feature: Managing collections | ||
In order to present the content in specific collections in my store | ||
As an Administrator | ||
I want to be able to edit and remove existing collections | ||
|
||
Background: | ||
Given the store operates on a single channel in "United States" | ||
Given I am logged in as an administrator | ||
|
||
@ui | ||
Scenario: Deleting collection | ||
Given there is a collection in the store | ||
When I go to the collections page | ||
And I delete this collection | ||
Then I should be notified that the collection has been deleted | ||
And I should see empty list of collections | ||
|
||
@ui | ||
Scenario: Seeing disabled code field while editing a collection | ||
Given there is a collection in the store | ||
When I want to edit this collection | ||
Then the code field should be disabled |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
@shop_collections | ||
Feature: Getting data from cms collections | ||
In order to present dynamic content in my store | ||
As an API user | ||
I want to be able to display collections | ||
|
||
Background: | ||
Given the store operates on a single channel in "United States" | ||
And there is a collection in the store | ||
And there is an existing collection with "collection-1" code | ||
|
||
@api | ||
Scenario: Browsing collections | ||
Given I want to browse collections | ||
Then I should see 2 collections in the list | ||
And I should see collection with code "collection-1" | ||
|
||
@api | ||
Scenario: Displaying collection | ||
Given I view collection with code "collection-1" | ||
Then I should see collection name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
@shop_pages | ||
Feature: Browsing pages by section | ||
Feature: Browsing pages by collection | ||
In order to read content like articles or blog posts | ||
As a Customer | ||
I want to browse pages by specific sections | ||
I want to browse pages by specific collections | ||
|
||
Background: | ||
Given the store operates on a single channel in "United States" | ||
|
||
@ui | ||
Scenario: Browsing pages by section | ||
Given there is a "Blog" section in the store | ||
Scenario: Browsing pages by collection | ||
Given there is a "Blog" collection in the store | ||
And there are 15 pages in the store | ||
And these pages have this section associated with it | ||
When I go to the section pages list for the "blog" section | ||
And these pages have this collection associated with it | ||
When I go to the collection pages list for the "blog" collection | ||
Then I should see 10 pages on the page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
|
||
/* | ||
* This file was created by developers working at BitBag | ||
* Do you need more information about us and what we do? Visit our https://bitbag.io website! | ||
* We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace spec\BitBag\SyliusCmsPlugin\Assigner; | ||
|
||
use BitBag\SyliusCmsPlugin\Assigner\CollectionsAssigner; | ||
use BitBag\SyliusCmsPlugin\Assigner\CollectionsAssignerInterface; | ||
use BitBag\SyliusCmsPlugin\Entity\CollectibleInterface; | ||
use BitBag\SyliusCmsPlugin\Entity\CollectionInterface; | ||
use BitBag\SyliusCmsPlugin\Repository\CollectionRepositoryInterface; | ||
use PhpSpec\ObjectBehavior; | ||
|
||
final class CollectionsAssignerSpec extends ObjectBehavior | ||
{ | ||
public function let(CollectionRepositoryInterface $collectionRepository): void | ||
{ | ||
$this->beConstructedWith($collectionRepository); | ||
} | ||
|
||
public function it_is_initializable(): void | ||
{ | ||
$this->shouldHaveType(CollectionsAssigner::class); | ||
} | ||
|
||
public function it_implements_collections_assigner_interface(): void | ||
{ | ||
$this->shouldHaveType(CollectionsAssignerInterface::class); | ||
} | ||
|
||
public function it_assigns_collections( | ||
CollectionRepositoryInterface $collectionRepository, | ||
CollectionInterface $aboutCollection, | ||
CollectionInterface $blogCollection, | ||
CollectibleInterface $collectionsAware | ||
): void | ||
{ | ||
$collectionRepository->findOneBy(['code' => 'about'])->willReturn($aboutCollection); | ||
$collectionRepository->findOneBy(['code' => 'blog'])->willReturn($blogCollection); | ||
|
||
$collectionsAware->addCollection($aboutCollection)->shouldBeCalled(); | ||
$collectionsAware->addCollection($blogCollection)->shouldBeCalled(); | ||
|
||
$this->assign($collectionsAware, ['about', 'blog']); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.