Fix upsert billing (#24)

This commit updates the product_id and variant_id in both the subscription_items and order_items in the billing tests. Updates also include adding new checks to verify these changes. Changes are reflected in corresponding SQL files for personal and team billing subscriptions/orders tests.
This commit is contained in:
Giancarlo Buomprisco
2024-05-15 11:08:19 +07:00
committed by GitHub
parent fe86b04d95
commit 4e50094808
8 changed files with 63 additions and 39 deletions

View File

@@ -80,7 +80,7 @@ SELECT public.upsert_subscription(tests.get_supabase_uid('primary_owner'), 'cus_
},
{
"id": "sub_456",
"product_id": "prod_test_2",
"product_id": "prod_test_3",
"variant_id": "var_test_2",
"type": "flat",
"price_amount": 2000,
@@ -97,6 +97,13 @@ SELECT row_eq(
'The subscription items should be updated'
);
-- Verify that the subscription items were updated correctly
SELECT row_eq(
$$ select product_id from subscription_items where id = 'sub_456' $$,
row('prod_test_3'::varchar),
'The subscription items should be updated'
);
-- Verify that the subscription items were updated correctly
SELECT row_eq(
$$ select interval from subscription_items where variant_id = 'var_test_2' $$,