mirror of
https://github.com/tiennm99/ccs.git
synced 2026-09-10 00:17:17 +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)) {
|
if (isGeminiQuotaResult(quota)) {
|
||||||
const hasBucketResetTime = quota.buckets.some((bucket) => !!bucket.resetTime);
|
const hasBucketResetTime = quota.buckets.some((bucket) => !!bucket.resetTime);
|
||||||
const hasEntitlementTier =
|
const hasEntitlementTier =
|
||||||
!!quota.entitlement?.rawTierLabel || quota.entitlement?.normalizedTier !== 'unknown';
|
!!quota.entitlement?.rawTierLabel ||
|
||||||
|
(!!quota.entitlement && quota.entitlement.normalizedTier !== 'unknown');
|
||||||
const distinctTokenTypes = Array.from(
|
const distinctTokenTypes = Array.from(
|
||||||
new Set(
|
new Set(
|
||||||
quota.buckets
|
quota.buckets
|
||||||
|
|||||||
@@ -83,6 +83,20 @@ describe('QuotaTooltipContent', () => {
|
|||||||
expect(screen.getByText(expectedReset)).toBeInTheDocument();
|
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', () => {
|
it('falls back to the shared reset indicator when Gemini buckets omit reset timestamps', () => {
|
||||||
vi.useFakeTimers();
|
vi.useFakeTimers();
|
||||||
vi.setSystemTime(new Date('2026-01-29T00:00:00Z'));
|
vi.setSystemTime(new Date('2026-01-29T00:00:00Z'));
|
||||||
|
|||||||
Reference in New Issue
Block a user