mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-16 08:17:11 +00:00
fix(ui): preserve Gemini tier fallback without entitlement
This commit is contained in:
@@ -378,7 +378,8 @@ export function QuotaTooltipContent({ quota, resetTime }: QuotaTooltipContentPro
|
||||
if (isGeminiQuotaResult(quota)) {
|
||||
const hasBucketResetTime = quota.buckets.some((bucket) => !!bucket.resetTime);
|
||||
const hasEntitlementTier =
|
||||
!!quota.entitlement?.rawTierLabel || quota.entitlement?.normalizedTier !== 'unknown';
|
||||
!!quota.entitlement?.rawTierLabel ||
|
||||
(!!quota.entitlement && quota.entitlement.normalizedTier !== 'unknown');
|
||||
const distinctTokenTypes = Array.from(
|
||||
new Set(
|
||||
quota.buckets
|
||||
|
||||
@@ -83,6 +83,20 @@ describe('QuotaTooltipContent', () => {
|
||||
expect(screen.getByText(expectedReset)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('renders the Gemini tier label when entitlement evidence is absent', () => {
|
||||
const quota = createGeminiQuotaResult({
|
||||
entitlement: undefined,
|
||||
tierLabel: 'Legacy Pro',
|
||||
tierId: null,
|
||||
creditBalance: null,
|
||||
});
|
||||
|
||||
render(<QuotaTooltipContent quota={quota} resetTime={null} />);
|
||||
|
||||
expect(screen.getByText('Tier')).toBeInTheDocument();
|
||||
expect(screen.getByText('Legacy Pro')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('falls back to the shared reset indicator when Gemini buckets omit reset timestamps', () => {
|
||||
vi.useFakeTimers();
|
||||
vi.setSystemTime(new Date('2026-01-29T00:00:00Z'));
|
||||
|
||||
Reference in New Issue
Block a user