commit 8af81daf63b1c9771785a36a8e5be8820720e884
parent 9b08843c54a93d83b2df70cad9d25093b85720e1
Author: Christian Grothoff <christian@grothoff.org>
Date: Fri, 30 Oct 2026 10:22:55 +0100
use build-in unit, now that unit-existence is enforced
Diffstat:
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/packages/taler-harness/src/integrationtests/test-merchant-instances.ts b/packages/taler-harness/src/integrationtests/test-merchant-instances.ts
@@ -65,18 +65,24 @@ async function checkMerchantCategories(
categoryId = categoryJson.category_id;
}
+ // "Piece" is a builtin unit slug. Since merchant.git f7886328 the backend
+ // resolves a product's unit against merchant_custom_units and
+ // merchant.merchant_builtin_units and answers 404
+ // MERCHANT_GENERIC_UNIT_UNKNOWN for anything else, so a free-form unit no
+ // longer works. "Piece" carries unit_allow_fraction=false and
+ // unit_precision_level=0, which is what an unknown unit used to default to.
for (const product of [
{
product_id: "foo",
description: "Bla Bla",
- unit: "item",
+ unit: "Piece",
price: "TESTKUDOS:6",
total_stock: -1,
},
{
product_id: "bar",
description: "Bla Bla",
- unit: "item",
+ unit: "Piece",
price: "TESTKUDOS:2",
total_stock: -1,
categories: [categoryId],
@@ -84,7 +90,7 @@ async function checkMerchantCategories(
{
product_id: "baz",
description: "Eggs",
- unit: "item",
+ unit: "Piece",
price: "TESTKUDOS:42",
total_stock: -1,
},