https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42605 --- Comment #4 from Andrii Nugged <nugged@gmail.com> --- Created attachment 203821 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203821&action=edit Bug 42605: Test order receiving preference behavior The existing regression test checks the values exposed through Koha.prefs, but does not exercise the receiving UI. It also stores row arrays returned by cy.task("query") and passes them back to cy.set_syspref(), which restores both preferences as "[object Object]" instead of their original values. Store the scalar preference values and clean up the invoice explicitly. Exercise the rendered receiving behavior for a basket that inherits AcqCreateItem, one that explicitly overrides it with "ordering", and a basket that creates items on receiving. The explicit "ordering" case is a control: it does not use the broken system-preference fallback and already works without the production fix. The empty items table occurs when the basket uses the system preference, while the receiving case covers the UniqueItemFields split path. This changes tests only. Test plan: Before applying the patches: 1. Set AcqCreateItem to "placing an order" and UniqueItemFields to "barcode". 2. Create one basket that uses the system preference and another basket explicitly set to create items when placing an order. Add an order with an item to each basket, close both baskets, and receive the orders. 3. Confirm that the inherited basket has no existing item row or Receive checkbox, while the explicitly configured basket displays both. 4. Create a basket set to create items when receiving. Add an order, close the basket, and receive the order. 5. Confirm that no item-entry fields or Add item button are displayed. Apply both patches on this bug. After applying the patches: 1. Receive the order from the inherited basket again. 2. Confirm that its existing item and Receive checkbox are displayed. 3. Confirm that the explicitly configured basket still displays its item and Receive checkbox. 4. Receive the order from the basket that creates items when receiving. 5. Confirm that the item-entry fields and Add item button are displayed. Co-Authored-By: Loontik <loontik@nugged.team> -- You are receiving this mail because: You are watching all bug changes.