create(); app(EcommerceUserProfileRepositoryInterface::class)->setPreferredCurrency($user->id, 'JPY'); Sanctum::actingAs($user); $response = $this->getJson('/api/auth/user'); $response->assertOk(); // currentUser 를 채우는 /api/auth/user 응답에 영속 통화가 실려야 한다 (D1 회귀) $response->assertJsonPath('data.ecommerce_preferred_currency', 'JPY'); } public function test_auth_user_response_has_currency_key_when_unset(): void { $user = User::factory()->create(); Sanctum::actingAs($user); $response = $this->getJson('/api/auth/user'); $response->assertOk(); // 미설정이어도 키는 존재(null) — 프론트가 default_currency 로 폴백할 수 있도록 $response->assertJsonPath('data.ecommerce_preferred_currency', null); } }