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

Add automated tests for unit price in backoffice #7260

Conversation

jibees
Copy link
Contributor

@jibees jibees commented Mar 29, 2021

What? Why?

This PR adds 3 tests for unit price in backoffice, for each 3 cases:

  • creating a new product
  • creating a new variant
  • editing an existing variant

Closes #7069

What should we test?

Green build.

Release notes

Add automated tests for unit price in backoffice

Changelog Category: Technical changes

@jibees jibees self-assigned this Mar 29, 2021
@jibees jibees force-pushed the 7069-add-automated-tests-for-unit-price-in-backoffice branch from 96dfc13 to a96245b Compare March 29, 2021 19:18
@jibees jibees requested a review from mkllnk March 29, 2021 19:48
app/views/spree/admin/products/new.html.haml Outdated Show resolved Hide resolved
spec/features/admin/unit_price_spec.rb Outdated Show resolved Hide resolved
spec/features/admin/unit_price_spec.rb Outdated Show resolved Hide resolved
spec/features/admin/unit_price_spec.rb Outdated Show resolved Hide resolved
spec/features/admin/unit_price_spec.rb Outdated Show resolved Hide resolved
spec/features/admin/unit_price_spec.rb Outdated Show resolved Hide resolved
@jibees jibees force-pushed the 7069-add-automated-tests-for-unit-price-in-backoffice branch from a96245b to 09c44f2 Compare March 30, 2021 08:09
Copy link
Member

@mkllnk mkllnk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's much better! 😄

@jibees jibees force-pushed the 7069-add-automated-tests-for-unit-price-in-backoffice branch from 09c44f2 to e9795ea Compare April 1, 2021 07:34
@codecov
Copy link

codecov bot commented Apr 1, 2021

Codecov Report

Merging #7260 (4429ee5) into master (d7cadde) will not change coverage.
The diff coverage is n/a.

❗ Current head 4429ee5 differs from pull request most recent head 9126901. Consider uploading reports for the commit 9126901 to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##           master    #7260   +/-   ##
=======================================
  Coverage   89.68%   89.68%           
=======================================
  Files         648      648           
  Lines       18849    18849           
=======================================
  Hits        16905    16905           
  Misses       1944     1944           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d7cadde...9126901. Read the comment docs.

@Matt-Yorkley
Copy link
Contributor

Needs a rebase 👍

jibees added 4 commits April 2, 2021 15:22
 - Use `variant_unit_price` for `id` attribute and `variant[unit_price]` for `name` attribute
 - Previously, there was an duplicated `#id` on the page because we used `:price`
 - So, `<label />` is rightly linked to its `<input />`
3 cases:
 - creating a new product
 - creating a new variant
 - editing an existing variant
@jibees jibees force-pushed the 7069-add-automated-tests-for-unit-price-in-backoffice branch from e9795ea to 9126901 Compare April 2, 2021 13:23
@jibees
Copy link
Contributor Author

jibees commented Apr 2, 2021

Needs a rebase 👍

Done!

Copy link
Contributor

@andrewpbrett andrewpbrett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks @jibees. The build is green apart from the CodeCov check so I'm going to merge.

@andrewpbrett andrewpbrett merged commit b584659 into openfoodfoundation:master Apr 3, 2021
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

Successfully merging this pull request may close these issues.

Add automated tests for unit price in backoffice
4 participants