سامانه صدور فاکتور و حسابداری
test(finora): honor real two-company license limit in disposable JWT fixture
davoodmehraban89 committed
Nov 23, 2026 at 13:13 UTC
b309e240be66137ccf042aa728935eaf31130662
1 file changed
+3
-1
scripts/wp2-stock-tenant-jwt-e2e.mjs
+3
-1
@@ -112,11 +112,13 @@ try{
112
sql('insert into public.organizations(id,owner_user_id,name) values '+
113
'('+quote(orgA)+','+quote(a.id)+','+quote('QA223 org A')+'),'+
114
'('+quote(orgB)+','+quote(b.id)+','+quote('QA223 org B')+');'+
115
- 'update public.licenses set organization_id='+quote(orgA)+' where user_id='+quote(a.id)+';'+
115
+ 'update public.licenses set organization_id='+quote(orgA)+',max_companies=2 where user_id='+quote(a.id)+';'+
116
'update public.licenses set organization_id='+quote(orgB)+' where user_id='+quote(b.id)+';'+
117
'insert into public.organization_members(organization_id,user_id,status,is_owner) values '+
118
'('+quote(orgA)+','+quote(a.id)+','+quote('active')+',true),'+
119
'('+quote(orgB)+','+quote(b.id)+','+quote('active')+',true);');
120
+ // The disposable fixture needs A's two companies: default license capacity is 1.
121
+ // Raise only A's local test license to 2, without bypassing its DB trigger.
122
const seed=[
123
[orgA,a.id,'companies',ca1,{name:'Company A1'}],
124
[orgA,a.id,'companies',ca2,{name:'Company A2'}],