mirror of
https://github.com/tiennm99/ccs.git
synced 2026-09-02 22:17:14 +00:00
style(ui): format files for enforced prettier rules
This commit is contained in:
@@ -73,7 +73,9 @@ export function ExtendedContextToggle({
|
|||||||
<div className="flex items-start gap-2 text-xs text-muted-foreground">
|
<div className="flex items-start gap-2 text-xs text-muted-foreground">
|
||||||
<Info className="w-3.5 h-3.5 mt-0.5 shrink-0" />
|
<Info className="w-3.5 h-3.5 mt-0.5 shrink-0" />
|
||||||
<div className="space-y-1">
|
<div className="space-y-1">
|
||||||
<p>Applies the explicit <code>[1m]</code> long-context suffix to compatible saved mappings.</p>
|
<p>
|
||||||
|
Applies the explicit <code>[1m]</code> long-context suffix to compatible saved mappings.
|
||||||
|
</p>
|
||||||
<p className="text-[10px]">{behaviorHint}</p>
|
<p className="text-[10px]">{behaviorHint}</p>
|
||||||
<p className="text-amber-600 dark:text-amber-500">
|
<p className="text-amber-600 dark:text-amber-500">
|
||||||
CCS only saves <code>[1m]</code>. Provider pricing and entitlement are separate, and
|
CCS only saves <code>[1m]</code>. Provider pricing and entitlement are separate, and
|
||||||
|
|||||||
@@ -68,9 +68,7 @@ describe('AddAccountDialog power user mode', () => {
|
|||||||
it('skips the Gemini typed acknowledgement when power user mode is enabled', async () => {
|
it('skips the Gemini typed acknowledgement when power user mode is enabled', async () => {
|
||||||
fetchMock.mockResolvedValue(createJsonResponse({ antigravityAckBypass: true }));
|
fetchMock.mockResolvedValue(createJsonResponse({ antigravityAckBypass: true }));
|
||||||
|
|
||||||
render(
|
render(<AddAccountDialog open onClose={vi.fn()} provider="gemini" displayName="Gemini" />);
|
||||||
<AddAccountDialog open onClose={vi.fn()} provider="gemini" displayName="Gemini" />
|
|
||||||
);
|
|
||||||
|
|
||||||
await waitFor(() =>
|
await waitFor(() =>
|
||||||
expect(fetchMock).toHaveBeenCalledWith('/api/settings/auth/antigravity-risk')
|
expect(fetchMock).toHaveBeenCalledWith('/api/settings/auth/antigravity-risk')
|
||||||
@@ -95,9 +93,7 @@ describe('AddAccountDialog power user mode', () => {
|
|||||||
it('keeps the Gemini typed acknowledgement when power user mode is disabled', async () => {
|
it('keeps the Gemini typed acknowledgement when power user mode is disabled', async () => {
|
||||||
fetchMock.mockResolvedValue(createJsonResponse({ antigravityAckBypass: false }));
|
fetchMock.mockResolvedValue(createJsonResponse({ antigravityAckBypass: false }));
|
||||||
|
|
||||||
render(
|
render(<AddAccountDialog open onClose={vi.fn()} provider="gemini" displayName="Gemini" />);
|
||||||
<AddAccountDialog open onClose={vi.fn()} provider="gemini" displayName="Gemini" />
|
|
||||||
);
|
|
||||||
|
|
||||||
await waitFor(() =>
|
await waitFor(() =>
|
||||||
expect(fetchMock).toHaveBeenCalledWith('/api/settings/auth/antigravity-risk')
|
expect(fetchMock).toHaveBeenCalledWith('/api/settings/auth/antigravity-risk')
|
||||||
@@ -114,9 +110,7 @@ describe('AddAccountDialog power user mode', () => {
|
|||||||
it('surfaces a power user mode fetch failure and fails closed for Gemini', async () => {
|
it('surfaces a power user mode fetch failure and fails closed for Gemini', async () => {
|
||||||
fetchMock.mockRejectedValue(new Error('network down'));
|
fetchMock.mockRejectedValue(new Error('network down'));
|
||||||
|
|
||||||
render(
|
render(<AddAccountDialog open onClose={vi.fn()} provider="gemini" displayName="Gemini" />);
|
||||||
<AddAccountDialog open onClose={vi.fn()} provider="gemini" displayName="Gemini" />
|
|
||||||
);
|
|
||||||
|
|
||||||
await waitFor(() =>
|
await waitFor(() =>
|
||||||
expect(toast.error).toHaveBeenCalledWith(
|
expect(toast.error).toHaveBeenCalledWith(
|
||||||
@@ -125,7 +119,9 @@ describe('AddAccountDialog power user mode', () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
expect(
|
expect(
|
||||||
screen.getByText('Failed to load power user mode settings. Check Settings > Proxy and try again.')
|
screen.getByText(
|
||||||
|
'Failed to load power user mode settings. Check Settings > Proxy and try again.'
|
||||||
|
)
|
||||||
).toBeInTheDocument();
|
).toBeInTheDocument();
|
||||||
expect(screen.getByText(/Type exact phrase to continue/i)).toBeInTheDocument();
|
expect(screen.getByText(/Type exact phrase to continue/i)).toBeInTheDocument();
|
||||||
expect(screen.getByRole('button', { name: 'Authenticate' })).toBeDisabled();
|
expect(screen.getByRole('button', { name: 'Authenticate' })).toBeDisabled();
|
||||||
|
|||||||
@@ -11,9 +11,7 @@ function createJsonResponse(body: Record<string, unknown>, status = 200): Respon
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const wrapper = ({ children }: { children: ReactNode }) => (
|
const wrapper = ({ children }: { children: ReactNode }) => <AllProviders>{children}</AllProviders>;
|
||||||
<AllProviders>{children}</AllProviders>
|
|
||||||
);
|
|
||||||
|
|
||||||
describe('useProviderEditor', () => {
|
describe('useProviderEditor', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -51,15 +51,15 @@ const boundedLayoutContracts = [
|
|||||||
] as const;
|
] as const;
|
||||||
|
|
||||||
describe('bounded CodeEditor consumers', () => {
|
describe('bounded CodeEditor consumers', () => {
|
||||||
it.each(boundedConsumers)('$file opts into fill-parent mode for every bounded editor', ({
|
it.each(boundedConsumers)(
|
||||||
file,
|
'$file opts into fill-parent mode for every bounded editor',
|
||||||
expectedCount,
|
({ file, expectedCount }) => {
|
||||||
}) => {
|
const source = readFileSync(resolve(process.cwd(), file), 'utf8');
|
||||||
const source = readFileSync(resolve(process.cwd(), file), 'utf8');
|
const matches = source.match(/heightMode="fill-parent"/g) ?? [];
|
||||||
const matches = source.match(/heightMode="fill-parent"/g) ?? [];
|
|
||||||
|
|
||||||
expect(matches).toHaveLength(expectedCount);
|
expect(matches).toHaveLength(expectedCount);
|
||||||
});
|
}
|
||||||
|
);
|
||||||
|
|
||||||
it.each(boundedLayoutContracts)(
|
it.each(boundedLayoutContracts)(
|
||||||
'$file keeps bounded editor ancestors shrinkable',
|
'$file keeps bounded editor ancestors shrinkable',
|
||||||
|
|||||||
@@ -50,11 +50,7 @@ describe('CodeEditor', () => {
|
|||||||
|
|
||||||
it('preserves content mode as the default layout contract', () => {
|
it('preserves content mode as the default layout contract', () => {
|
||||||
const { container } = render(
|
const { container } = render(
|
||||||
<CodeEditor
|
<CodeEditor value={'{\n "provider": "openrouter"\n}'} onChange={vi.fn()} language="json" />
|
||||||
value={'{\n "provider": "openrouter"\n}'}
|
|
||||||
onChange={vi.fn()}
|
|
||||||
language="json"
|
|
||||||
/>
|
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(container.querySelector('[data-slot="code-editor-viewport"]')).not.toBeInTheDocument();
|
expect(container.querySelector('[data-slot="code-editor-viewport"]')).not.toBeInTheDocument();
|
||||||
|
|||||||
Reference in New Issue
Block a user