refactor(spec/system/admin/subscriptions_spec.rb): issue #7483

Add context when click Create Subscription button on third page after click next button previously on second page.

It has selector for price, input for quantity and selector for total price.
This commit is contained in:
paulo-felipe
2023-05-17 21:48:25 -03:00
parent f0da85d723
commit 03aade4072

View File

@@ -410,6 +410,20 @@ describe 'Subscriptions' do
select2_select shop.name, from: "shop_id"
expect(page).to have_selector "td.items.panel-toggle"
end
it 'has selector for price, input for quantity and selector for total price' do
click_button('Create Subscription')
select2_select shop.name, from: "shop_id"
first("td.items.panel-toggle").click
within 'table#subscription-line-items tr.item', match: :first do
expect(page).to have_selector '.description',
text: "#{shop_product.name} - #{shop_variant.full_name}"
expect(page).to have_selector 'td.price', text: "$7.75"
expect(page).to have_input 'quantity', with: "3"
expect(page).to have_selector 'td.total', text: "$23.25"
end
end
end
end
end