test: fix auth button and localization assertions

This commit is contained in:
lzt404 committed 2026-09-20 18:09:32 +08:00
1 parent 100f5df737
commit efe9b4b936
2 files changed
+12 -2

No files matched your search

+1 -1
View File
@@ -56,7 +56,7 @@ describe('控件自身反馈', () => {
visit(source);
const attributes = button?.attributes.properties.filter(ts.isJsxAttribute);
expect(attributes?.find((attribute) => attribute.name.getText(source) === 'className')?.initializer?.getText(source))
.toBe("{`${disabled ? 'primary-button' : 'secondary-button'} compact-button`}");
.toBe("{`${disabled ? 'primary-button' : 'secondary-button'} compact-button auth-card-toggle`}");
expect(attributes?.find((attribute) => attribute.name.getText(source) === 'disabled')?.initializer?.getText(source))
.toBe('{busy}');
const styles = readFileSync(new URL('../src/styles.css', import.meta.url), 'utf8');
+11 -1
View File
@@ -5,7 +5,17 @@ import { fileURLToPath } from 'node:url';
import ts from 'typescript';
const sourceRoot = fileURLToPath(new URL('../src/', import.meta.url));
const technicalText = new Set(['EasyCLIProxyAPI', 'WebSocket', 'Fast', 'ms', 'auto']);
const technicalText = new Set([
'EasyCLIProxyAPI',
'WebSocket',
'Fast',
'HTTP',
'auto',
'excluded_models',
'headers',
'ms',
'note',
]);
const technicalPlaceholders = new Set(['1h', 'sk-...', 'gpt-5.6-terra', 'https://...']);
function componentFiles(directory: string): string[] {