This commit is contained in:
antv
2026-07-16 16:01:15 +07:00
parent 939287d9b3
commit 9c20a25111
10 changed files with 123 additions and 180 deletions
+24
View File
@@ -115,5 +115,29 @@ class SendThankCardTest extends TestCase
]
]);
}
public function test_get_recipient_stats_returns_correct_sent_count(): void
{
$this->actingAs($this->sender);
// Before sending, stats should return 0 sent cards
$response = $this->getJson(route('user.recipient_stats', ['receiver' => '5002']));
$response->assertStatus(200);
$response->assertJson([
'success' => true,
'sent_count' => 0,
]);
// Send a card to the receiver
$this->userService->sendThankcards($this->sender, '5002', 3);
// Now it should return 3
$response = $this->getJson(route('user.recipient_stats', ['receiver' => '5002']));
$response->assertStatus(200);
$response->assertJson([
'success' => true,
'sent_count' => 3,
]);
}
}