Skip to content

Commit 50b5c8d

Browse files
vsilentCopilot
andcommitted
fix(tests): fix marketplace_integration compilation errors
StackTemplate struct initializers in tests - Fix user_has_plan() calls: add None as 3rd argument (user_token) to match the updated connector trait signature Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent d838708 commit 50b5c8d

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

tests/marketplace_integration.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ async fn test_deployment_free_template_allowed() {
4343
created_at: Some(Utc::now()),
4444
updated_at: Some(Utc::now()),
4545
approved_at: Some(Utc::now()),
46+
verifications: serde_json::json!({}),
4647
};
4748

4849
// Should allow deployment of free template
@@ -82,6 +83,7 @@ async fn test_deployment_plan_requirement_validated() {
8283
created_at: Some(Utc::now()),
8384
updated_at: Some(Utc::now()),
8485
approved_at: Some(Utc::now()),
86+
verifications: serde_json::json!({}),
8587
};
8688

8789
// Should allow deployment (mock user has professional plan)
@@ -125,6 +127,7 @@ async fn test_deployment_owned_paid_template_allowed() {
125127
created_at: Some(Utc::now()),
126128
updated_at: Some(Utc::now()),
127129
approved_at: Some(Utc::now()),
130+
verifications: serde_json::json!({}),
128131
};
129132

130133
// The validator passes template.id to user_owns_template, but mock checks the string representation
@@ -268,6 +271,7 @@ async fn test_deployment_validation_flow_with_connector() {
268271
created_at: Some(Utc::now()),
269272
updated_at: Some(Utc::now()),
270273
approved_at: Some(Utc::now()),
274+
verifications: serde_json::json!({}),
271275
};
272276

273277
let result = validator
@@ -299,6 +303,7 @@ async fn test_deployment_validation_flow_with_connector() {
299303
created_at: Some(Utc::now()),
300304
updated_at: Some(Utc::now()),
301305
approved_at: Some(Utc::now()),
306+
verifications: serde_json::json!({}),
302307
};
303308

304309
let result = validator
@@ -369,13 +374,13 @@ async fn test_plan_access_control() {
369374

370375
// Mock always grants plan access
371376
let has_pro = connector
372-
.user_has_plan("user1", "professional")
377+
.user_has_plan("user1", "professional", None)
373378
.await
374379
.unwrap();
375380
assert!(has_pro, "Mock grants all plan access");
376381

377382
let has_enterprise = connector
378-
.user_has_plan("user1", "enterprise")
383+
.user_has_plan("user1", "enterprise", None)
379384
.await
380385
.unwrap();
381386
assert!(has_enterprise, "Mock grants all plan access");
@@ -411,6 +416,7 @@ async fn test_multiple_deployments_mixed_templates() {
411416
created_at: Some(Utc::now()),
412417
updated_at: Some(Utc::now()),
413418
approved_at: Some(Utc::now()),
419+
verifications: serde_json::json!({}),
414420
};
415421

416422
let result = validator
@@ -442,6 +448,7 @@ async fn test_multiple_deployments_mixed_templates() {
442448
created_at: Some(Utc::now()),
443449
updated_at: Some(Utc::now()),
444450
approved_at: Some(Utc::now()),
451+
verifications: serde_json::json!({}),
445452
};
446453

447454
let result = validator
@@ -478,6 +485,7 @@ async fn test_multiple_deployments_mixed_templates() {
478485
created_at: Some(Utc::now()),
479486
updated_at: Some(Utc::now()),
480487
approved_at: Some(Utc::now()),
488+
verifications: serde_json::json!({}),
481489
};
482490

483491
// The result will depend on whether the validator can verify ownership
@@ -531,6 +539,7 @@ fn test_template_status_values() {
531539
created_at: Some(Utc::now()),
532540
updated_at: Some(Utc::now()),
533541
approved_at: Some(Utc::now()),
542+
verifications: serde_json::json!({}),
534543
};
535544

536545
assert_eq!(template.status, "approved");

0 commit comments

Comments
 (0)