1
0
forked from boos/BoosAPI

fix: address review followups

This commit is contained in:
Cita
2026-03-23 16:24:31 +08:00
parent 4b903fdd3b
commit 653b7557a7
5 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -72,7 +72,7 @@ describe('Login surface', () => {
expect(githubLink.props.target).toBe('_blank'); expect(githubLink.props.target).toBe('_blank');
expect(tokenInput.props.type).toBe('password'); expect(tokenInput.props.type).toBe('password');
} finally { } finally {
root.unmount(); root?.unmount();
} }
}); });
}); });
@@ -139,7 +139,7 @@ export default function SiteDistributionChart({ data, loading }: SiteDistributio
value: (datum: unknown) => { value: (datum: unknown) => {
const item = coerceDatumRecord(datum); const item = coerceDatumRecord(datum);
const pct = safeNumber(item._percent_); const pct = safeNumber(item._percent_);
return `${safeNumber(pct).toFixed(1)}%`; return `${pct.toFixed(1)}%`;
}, },
}, },
{ {
+2 -2
View File
@@ -193,7 +193,7 @@ describe('DownstreamKeys page', () => {
expect(text).toContain('主分组'); expect(text).toContain('主分组');
expect(text).toContain('移动端'); expect(text).toContain('移动端');
} finally { } finally {
root.unmount(); root?.unmount();
} }
}); });
@@ -447,7 +447,7 @@ describe('DownstreamKeys page', () => {
expect(collectText(root!.root)).not.toContain('固定窗口对比'); expect(collectText(root!.root)).not.toContain('固定窗口对比');
expect(collectText(root!.root)).not.toContain('trend:2'); expect(collectText(root!.root)).not.toContain('trend:2');
} finally { } finally {
root.unmount(); root?.unmount();
} }
}); });
@@ -64,7 +64,7 @@ describe('Accounts create intent handling', () => {
const selects = root.root.findAllByType(ModernSelect); const selects = root.root.findAllByType(ModernSelect);
expect(selects[1]?.props.value).toBe('10'); expect(selects[1]?.props.value).toBe('10');
} finally { } finally {
root.unmount(); root?.unmount();
} }
}); });
@@ -77,7 +77,7 @@ describe('Accounts create intent handling', () => {
const selects = root.root.findAllByType(ModernSelect); const selects = root.root.findAllByType(ModernSelect);
expect(selects[1]?.props.value).toBe('10'); expect(selects[1]?.props.value).toBe('10');
} finally { } finally {
root.unmount(); root?.unmount();
} }
}); });
@@ -88,7 +88,7 @@ describe('Accounts create intent handling', () => {
expect(rendered).not.toContain('添加 Session 连接'); expect(rendered).not.toContain('添加 Session 连接');
expect(rendered).not.toContain('添加 API Key 连接'); expect(rendered).not.toContain('添加 API Key 连接');
} finally { } finally {
root.unmount(); root?.unmount();
} }
}); });
}); });
@@ -146,7 +146,7 @@ describe('Sites disabled models save', () => {
expect(apiMock.updateSiteDisabledModels).toHaveBeenCalledWith(1, ['gpt-4o']); expect(apiMock.updateSiteDisabledModels).toHaveBeenCalledWith(1, ['gpt-4o']);
} finally { } finally {
root.unmount(); root?.unmount();
} }
}); });
@@ -190,7 +190,7 @@ describe('Sites disabled models save', () => {
expect(apiMock.updateSiteDisabledModels).toHaveBeenCalledWith(1, ['gpt-4o']); expect(apiMock.updateSiteDisabledModels).toHaveBeenCalledWith(1, ['gpt-4o']);
} finally { } finally {
root.unmount(); root?.unmount();
} }
}); });
}); });