Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Spree Upgrade] Included vs not included Adjustments in the edit order page (1 broken test) #2940

Closed
luisramos0 opened this issue Oct 26, 2018 · 3 comments
Assignees

Comments

@luisramos0
Copy link
Contributor

luisramos0 commented Oct 26, 2018

There are no adjustments showing up on the edit order page in the following spec.
And we need to clarify what are order charges and what are price adjustments and how they map to the data model of order.adjustments.

  8) 
    As an administrator
    I want to manage orders
 as an enterprise manager viewing the edit page shows the order charges (non-tax adjustments)
     Failure/Error: expect(page).to have_selector "td", match: :first, text: adjustment.label
       expected to find visible css "td" with text "Shipping" within #<Capybara::Node::Element tag="tbody" path="//HTML[1]/BODY[1]/DIV[1]/DIV[1]/DIV[4]/DIV[1]/DIV[1]/DIV[1]/DIV[2]/DIV[2]/DIV[1]/DIV[1]/FIELDSET[1]/TABLE[1]/TBODY[1]"> but there were no matches
     # ./spec/features/admin/orders_spec.rb:244:in `block (6 levels) in <top (required)>'
     # ./spec/features/admin/orders_spec.rb:242:in `block (5 levels) in <top (required)>'
     # ./spec/features/admin/orders_spec.rb:241:in `block (4 levels) in <top (required)>'

and

 9) 
    As an administrator
    I want to manage orders
 as an enterprise manager viewing the edit page shows the order taxes
     Failure/Error:
       within('table.index tbody#price-adjustments') do
         expect(page).to have_selector "td", match: :first, text: "Tax 1"
         expect(page).to have_selector "td.total", text: Spree::Money.new(10)
       end
     
     Capybara::ElementNotFound:
       Unable to find visible css "table.index tbody#price-adjustments"
     # ./spec/features/admin/orders_spec.rb:257:in `block (4 levels) in <top (required)>'

The problem will probably be in the order factory used. Some detail must be missing, probably how payment or shipment is setup in the factory order_with_taxes that needs to be adapted to spree 2.

@luisramos0 luisramos0 changed the title [Spree Upgrade] [Broken Test] Fix Adjustments on edit order page [Spree Upgrade][Broken Test][Admin/Orders/Edit] Fix Adjustments on edit order page Oct 26, 2018
@luisramos0 luisramos0 changed the title [Spree Upgrade][Broken Test][Admin/Orders/Edit] Fix Adjustments on edit order page [Spree Upgrade][Broken Test][Admin/Orders/Edit] Fix Adjustments on edit order page (1 broken test( Nov 13, 2018
@luisramos0 luisramos0 changed the title [Spree Upgrade][Broken Test][Admin/Orders/Edit] Fix Adjustments on edit order page (1 broken test( [Spree Upgrade][Broken Test][Admin/Orders/Edit] Fix Adjustments on edit order page (1 broken test) Nov 13, 2018
@luisramos0 luisramos0 changed the title [Spree Upgrade][Broken Test][Admin/Orders/Edit] Fix Adjustments on edit order page (1 broken test) [Spree Upgrade][Admin/Orders/Edit] Fix Adjustments on edit order page (1 broken test) Nov 20, 2018
@luisramos0 luisramos0 changed the title [Spree Upgrade][Admin/Orders/Edit] Fix Adjustments on edit order page (1 broken test) [Spree Upgrade][Admin/Orders/Edit] Fix Adjustments on edit order page (2 broken tests) Nov 21, 2018
@luisramos0 luisramos0 changed the title [Spree Upgrade][Admin/Orders/Edit] Fix Adjustments on edit order page (2 broken tests) [Spree Upgrade][Admin/Orders/Edit] Fix Adjustments on edit order page (1 broken test) Jan 6, 2019
@luisramos0
Copy link
Contributor Author

The spec related to "non-tax adjustments" is now passing, but it shouldnt be. I think the spec is green because the spec is not picking up the adjustments, so no validation is being done. But the spec should see the adjustment and validate the adjustment is present on the page.
I think this is now a false positive.

So, there is one broken spec in this issue and one false positive (green spec) that I believe also needs to be fixed.

@luisramos0
Copy link
Contributor Author

I see this issue is being addressed in #3194

@luisramos0
Copy link
Contributor Author

This will not be fixed as part of #3194
It needs some investigation, the broken spec (order-charges) is not showing the tax of the product because the taxrate is marked as included_in_price and the current adjustments table . is not showing adjustments included in the line items, only order.adjustments. we may decide to change the test or change the view to show adjustments included in the price (order.tax_adjusments instead of order.adjusments for example would show the taxrate)

@luisramos0 luisramos0 changed the title [Spree Upgrade][Admin/Orders/Edit] Fix Adjustments on edit order page (1 broken test) [Spree Upgrade][Admin/Orders/Edit] Included vs not included Adjustments in the edit order page (1 broken test) Feb 1, 2019
@luisramos0 luisramos0 changed the title [Spree Upgrade][Admin/Orders/Edit] Included vs not included Adjustments in the edit order page (1 broken test) [Spree Upgrade] Included vs not included Adjustments in the edit order page (1 broken test) Feb 1, 2019
@luisramos0 luisramos0 self-assigned this Feb 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants