m
This commit is contained in:
@@ -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,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user