-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 #5870 from SuperGoodSoft/issue-5614/store-filter-o…
…n-order-index Add filtering by store to orders index component
- Loading branch information
Showing
3 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
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
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 |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
describe "Orders", type: :feature do | ||
before { sign_in create(:admin_user, email: '[email protected]') } | ||
|
||
it "lists products", :js do | ||
it "lists orders", :js do | ||
create(:order, number: "R123456789", total: 19.99) | ||
|
||
visit "/admin/orders" | ||
|
@@ -15,4 +15,31 @@ | |
expect(page).to have_content("$19.99") | ||
expect(page).to be_axe_clean | ||
end | ||
|
||
context "with multiple stores", :js do | ||
let!(:order_in_default_store) { create :order } | ||
let(:another_store) { create :store, name: "Another Store" } | ||
let!(:order_in_another_store) { create :order, store: another_store } | ||
|
||
it "can filter orders by store" do | ||
visit solidus_admin.orders_path | ||
|
||
click_on "In Progress" | ||
|
||
expect(page).to have_content(order_in_default_store.number) | ||
expect(page).to have_content(order_in_another_store.number) | ||
|
||
click_on "Filter" | ||
|
||
within("div[role='search']") do | ||
find('details', text: "Store").click | ||
expect(page).to have_content("Another Store") | ||
|
||
find('label', text: "Another Store").click | ||
end | ||
|
||
expect(page).to have_content(order_in_another_store.number) | ||
expect(page).to_not have_content(order_in_default_store.number) | ||
end | ||
end | ||
end |