Commit Graph

11212 Commits

Author SHA1 Message Date
filipefurtad0
2ef5cab3c2 Adds test to check permissions when updating a product 2024-06-17 14:58:37 +02:00
filipefurtad0
42634c68ef reverts changes on products_spec 2024-06-17 14:58:15 +02:00
filipefurtad0
5ecb844c01 Removes deleting and cloning test from the legacy bulk product edit page
These are covered in the new BUU products page
2024-06-17 14:58:09 +02:00
filipefurtad0
66f0870f42 Adds test case around shipped product
Removes test case around shipped product for legacy products page
2024-06-17 14:58:07 +02:00
Filipe
f7c22a0073 Revert "[Invoices] Notify if any order cannot be invoiced on bulk invoice sending" 2024-06-17 14:58:00 +02:00
Abdellani
a3255003b6 update tests 2024-06-17 14:57:40 +02:00
zanetagebka
c456e649b2 Fix Rails/Pluck Rubocops 2024-06-17 14:56:23 +02:00
filipefurtad0
f7500bba30 Removes product creation test
This is already covered some lines above and on e22bec014b/spec/system/admin/products_spec.rb (L29)
2024-06-17 14:56:23 +02:00
filipefurtad0
eb5eb7fa99 Corrects test case by adding expect
has_select? only returns true or false, it requires an assertion to assure the test is evaluated

Improves syntax
2024-06-17 14:56:23 +02:00
filipefurtad0
803e22bb45 Adds test to check permissions when updating a product 2024-06-17 14:56:23 +02:00
filipefurtad0
e2178d6039 Adds test to check permissions when creating a new product 2024-06-17 14:56:23 +02:00
filipefurtad0
327abf81ff Adds test around inactive product 2024-06-17 14:56:23 +02:00
filipefurtad0
bbcad09924 Adds test case on enterprise permissions 2024-06-17 14:56:23 +02:00
filipefurtad0
5e7e120fcb Addresses Gaetans review
Removes assertions from before block, as Delete case is tested elsewhere

Declares enterprise_user variable as a non-instance variable
2024-06-17 14:56:23 +02:00
filipefurtad0
2eb1bc4d0a reverts changes on products_spec 2024-06-17 14:56:23 +02:00
filipefurtad0
04cb6b40be Adds tests around managing rights -> 'as an enterprise manager' 2024-06-17 14:56:23 +02:00
filipefurtad0
ee15be3aac Adds a test to assure that the new product path works as expected
The funcitonaliy itself should not be affected by BUU, so the tests remain at ./spec/system/admin/products_spec.rb
2024-06-17 14:56:23 +02:00
filipefurtad0
11365dc9a5 Removes comment on issue #7180, now closed 2024-06-17 14:56:23 +02:00
filipefurtad0
a70e6af7ac Removes deleting and cloning test from the legacy bulk product edit page
These are covered in the new BUU products page
2024-06-17 14:56:23 +02:00
filipefurtad0
c06ac4ca4d Removes test case on access rights to the products page
Moves test on access rights to authentication_spec

The test on accessing the products page as an anonymous does not seem specific to the products page (IMO); as we're testing access rights and the Devise gem (right?) we're probably better off having this test in a more suitable and general context, such as as a spec dealing with authentications and redirects
2024-06-17 14:56:23 +02:00
filipefurtad0
514117865e Adds test case around shipped product
Removes test case around shipped product for legacy products page
2024-06-17 14:56:23 +02:00
Maikel Linke
f0ccfb1f91 Avoid flakiness with Capybara features
Capybara should be clever enought to scroll to an element. The old
method failed nine times in CI. I couldn't reproduce it locally but
let's see if this is better.
2024-06-17 14:56:23 +02:00
Filipe
03c5a9b4cc Revert "[Invoices] Notify if any order cannot be invoiced on bulk invoice sending" 2024-06-17 14:56:23 +02:00
cyrillefr
0beda91541 Requested changes on spec
- if possible no sleep in spec
2024-06-17 14:56:23 +02:00
cyrillefr
fb712be430 Update and Recalculate Fees after Order Adjusted in Backend
- when update on adjustment in payment, recalculation of
  correct adjustment was not done
- the corresponding spec
- an id to easy the finding of the change of fees in the spec
2024-06-17 14:56:23 +02:00
Maikel Linke
56398d4d0f Update stock levels of on-demand items
We weren't bothering with stock when items were on demand anyway. But we
want to track stock now so that we can backorder more when local stock
levels become negative.
2024-06-17 14:56:23 +02:00
Maikel Linke
29adbcb479 Import products from the FDC (Shopify) API 2024-06-17 14:56:23 +02:00
Maikel Linke
7e39917a07 Add service to access FDC API
The current implementation of the FDC is not adhering to the DFC
standard. The difference is added in this compatibility layer.

This should be temporary code. The FDC dev team should change their API
in their next development cycle.
2024-06-17 14:56:23 +02:00
Abdellani
4a434873bc update tests 2024-06-17 14:56:23 +02:00
zanetagebka
053076e062 Fix test 2024-06-17 14:56:23 +02:00
zanetagebka
028686eea4 Fix cops StringConcatenation 2024-06-17 14:56:23 +02:00
Maikel Linke
5925b023b3 Style/SendWithLiteralMethodName
Use method call directly instead of `public_send` with fixed argument.

The cop is declared unsafe. I think that is because it can also replace
`send` but we replace only `public_send` here.
2024-06-17 14:56:23 +02:00
cyrillefr
2ab61c423e Bugfix on spec 2024-06-17 14:56:23 +02:00
cyrillefr
40128d7311 Force start date before end date with range mode flatpickr
- modify view to get a flatpickr component in range mode
  - modify spec to take into account range mode
2024-06-17 14:56:23 +02:00
Abdul Aziz Ali
5fb1c0798d Display additional tax total in order #11680
Add new text key admin.order.edit.additional_tax_included_in_price
Add spec file for additional tax display. Add new trait for enterprise fee and calculator factory
2024-06-17 14:56:23 +02:00
David Cook
f97241dce3 Detect changes in price
Price is actually an association with lots of custom methods to make it look like a field, and so changes were ignored.
Now this issue is fixed, perhaps it should be moved to a concern..

Note, there are other delegated fields: product name and description may be assigned from the variant. But there's no hooks to save the prroduct, so I didn't include it when checking for changes.
2024-06-17 14:56:23 +02:00
isidzukuri
ba1133ad44 Do not commit to db unchanged products is bulk save 2024-06-17 14:56:23 +02:00
Ana Nunes da Silva
442fe8c956 Add div to sanitizer supported tags 2024-06-17 14:56:23 +02:00
Ana Nunes da Silva
cbee263222 Add safe trix tags to html sanitizer;
Use custom html sanitizer in product description.
2024-06-17 14:56:23 +02:00
Ana Nunes da Silva
4dfddd4801 Sanitize product description using rails default sanitizer 2024-06-17 14:56:23 +02:00
Ahmed Ejaz
e11a3ac53e 12398: fix failing specs 2024-06-17 14:56:22 +02:00
Ahmed Ejaz
897596de5f remove delete methods from products reflex 2024-06-17 14:56:22 +02:00
David Cook
1ae1c95e15 When dropdown fields don't allow blank, but are blank, show as changed
They were already counted as changed by the javascript, but didn't have a 'changed' class to indicate it.
The reason they are 'changed', is because the dropdown has no blank option, and is forced to select the first item in the list.

This is purely to cover the case of invalid data, but should help a lot when debugging data issues. I don't think it's any less efficient, because the extra 'classList.toggle' calls don't do anything on unchanged fields.
2024-06-17 14:56:22 +02:00
David Cook
746b8fc703 Remove redundant code 2024-06-17 14:56:22 +02:00
filipefurtad0
8de9055e7b Removes tests on edit action, under the Delete section 2024-06-17 14:56:22 +02:00
filipefurtad0
9af7975d1c Applies existing helper to assert on rows with product name 2024-06-17 14:56:22 +02:00
filipefurtad0
bea6344fc5 Assures the Edit button link is always displayed for the first variant,
although the delete button is not

Also should work for a second (non-default variant)

Removes unecessary test cases
2024-06-17 14:56:22 +02:00
filipefurtad0
43ee364bf8 Removes pending test case - covered in:
- Changing producers, category and tax category, done in 15ee4f6

- Updating Unit value, done in 49226ff

Removes comment about errors for empty variant_unit_name

I think this was done in commit f05d27b

Would you agree @dacook?
2024-06-17 14:56:22 +02:00
filipefurtad0
3009490c15 Updates tests around product and variant search
Adds test for a non-existing product

Adds test for variant search

Improves tests with multiple variants
2024-06-17 14:56:22 +02:00
filipefurtad0
20fb38da96 Adds tests around using the page
- with no products

- column display dropdown

- listing products with several variants
2024-06-17 14:56:22 +02:00