Skip to content

Commit

Permalink
Adding tests for Global Search
Browse files Browse the repository at this point in the history
  • Loading branch information
bobdenotter committed Jun 18, 2020
1 parent 916ec53 commit 4031de7
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 5 deletions.
1 change: 1 addition & 0 deletions assets/js/app/toolbar/Components/Toolbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
class="form-control"
:placeholder="labels['listing.placeholder_search']"
name="filter"
id="global-search"
:value="filterValue"
/>
<div class="input-group-append">
Expand Down
2 changes: 1 addition & 1 deletion templates/content/listing.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
#}
<p>
<strong>{{ 'listing.title_filterby'|trans }}</strong>:
<input class="form-control" type="text" name="filter" value="{{ filterValue }}"
<input class="form-control" type="text" name="filter" id="content-filter" value="{{ filterValue }}"
placeholder="{{ 'listing.placeholder_filter'|trans }}"/>
</p>
</div>
Expand Down
31 changes: 31 additions & 0 deletions tests/e2e/dashboard_globalsearch.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Feature: Global Search on Dashboard

@javascript
@foo
Scenario: As an Admin I want to filter content
Given I am logged in as "admin"
And I am on "/bolt"

Then I should see "Bolt Dashboard"

When I fill "#global-search" element with "a"
And I press "Search"

Then I should be on "/bolt/?filter=a"
Then I should see 8 ".listing--container" elements
And I should see "All content, filtered by 'a'"

Then I wait 1 seconds

When I fill "#global-search" element with "Entries"
And I press "Search"
Then I should be on "/bolt/?filter=Entries"
Then I should see 1 ".listing--container" elements
And I should see "Entries" in the ".listing--container" element

Then I wait 1 seconds

When I fill "#global-search" element with ""
And I press "Search"
Then I should be on "/bolt/"
And I should see 8 ".listing--container" elements
11 changes: 7 additions & 4 deletions tests/e2e/record_listing.feature
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,23 @@ Feature: Record listing

Then I should see "Contentlisting"

When I fill "filter" element with "a"
When I fill "#content-filter" element with "a"
And I press "Filter"

Then I should be on "/bolt/content/entries?sortBy=&filter=a"
Then I should see 10 ".listing--container" elements

When I fill "filter" element with "Entries"
And I press "Filter"
Then I wait 1 seconds

When I fill "#content-filter" element with "Entries"
And I press "Filter"
Then I should be on "/bolt/content/entries?sortBy=&filter=Entries"
Then I should see 1 ".listing--container" elements
And I should see "Entries" in the ".listing--container" element

When I fill "filter" element with ""
Then I wait 1 seconds

When I fill "#content-filter" element with ""
And I press "Filter"
Then I should be on "/bolt/content/entries?sortBy=&filter="
And I should see 10 ".listing--container" elements
Expand Down

0 comments on commit 4031de7

Please sign in to comment.