fix(ui): hide model quota in /stats and refactor quota display (#24206)

This commit is contained in:
Dan Zaharia
2026-04-02 16:49:14 -04:00
committed by GitHub
parent e5adeaca80
commit 29caa52bb7
15 changed files with 986 additions and 748 deletions
@@ -0,0 +1,39 @@
/**
* @license
* Copyright 2026 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { describe, it, expect } from 'vitest';
import { ProgressBar } from './ProgressBar.js';
import { renderWithProviders } from '../../test-utils/render.js';
describe('<ProgressBar />', () => {
it('renders 0% correctly', async () => {
const { lastFrame } = await renderWithProviders(
<ProgressBar value={0} width={10} />,
);
expect(lastFrame()).toMatchSnapshot();
});
it('renders 50% correctly', async () => {
const { lastFrame } = await renderWithProviders(
<ProgressBar value={50} width={10} />,
);
expect(lastFrame()).toMatchSnapshot();
});
it('renders warning threshold correctly', async () => {
const { lastFrame } = await renderWithProviders(
<ProgressBar value={85} width={10} warningThreshold={80} />,
);
expect(lastFrame()).toMatchSnapshot();
});
it('renders error threshold correctly at 100%', async () => {
const { lastFrame } = await renderWithProviders(
<ProgressBar value={100} width={10} />,
);
expect(lastFrame()).toMatchSnapshot();
});
});