优化 你玩游戏我买单 页面

This commit is contained in:
2026-04-13 17:55:00 +08:00
parent 2eb732642b
commit 596c7f357f
3 changed files with 55 additions and 3 deletions
@@ -214,6 +214,29 @@ class BaccaratLossCoverControllerTest extends TestCase
$response->assertJsonPath('events.0.my_record.claimed_amount', 400);
}
/**
* 验证“当前活动”页签摘要不会把可领取中的历史活动当成当前活动。
*/
public function test_overview_summary_ignores_claimable_history_event(): void
{
$user = User::factory()->create();
$event = BaccaratLossCoverEvent::factory()->create([
'status' => 'claimable',
'starts_at' => now()->subHour(),
'ends_at' => now()->subMinutes(20),
'claim_deadline_at' => now()->addHours(12),
]);
$defaultResponse = $this->actingAs($user)->getJson(route('baccarat-loss-cover.summary'));
$defaultResponse->assertOk();
$defaultResponse->assertJsonPath('event.id', $event->id);
$defaultResponse->assertJsonPath('event.status', 'claimable');
$overviewResponse = $this->actingAs($user)->getJson(route('baccarat-loss-cover.summary', ['scene' => 'overview']));
$overviewResponse->assertOk();
$overviewResponse->assertJsonPath('event', null);
}
/**
* 验证活动进入可领取状态后会为 AI 小班长派发自动领取任务。
*/