feat: 合并代码后 系统设置 ui样式优化、bug修复、全局统一图标对齐等
This commit is contained in:
@@ -19,6 +19,9 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
import assert from 'node:assert/strict';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import test from 'node:test';
|
||||
import React from 'react';
|
||||
import * as Ant from 'antd';
|
||||
import { loadFrontendModule } from './helpers/loadFrontendModule.js';
|
||||
import { toConsoleTableChange } from '../src/components/console/consoleTableAdapter.js';
|
||||
import {
|
||||
consoleMenuPaths,
|
||||
@@ -28,6 +31,36 @@ import {
|
||||
resolveConsolePage,
|
||||
} from '../src/components/console/consoleRoutes.js';
|
||||
|
||||
test('settings tables share the log empty state while other console routes retain caller locale', async () => {
|
||||
let key = 'setting';
|
||||
const TableEmpty = () => null;
|
||||
const { ConsoleTable } = await loadFrontendModule(
|
||||
new URL('../src/components/console/ConsolePrimitives.jsx', import.meta.url),
|
||||
{
|
||||
react: React,
|
||||
antd: Ant,
|
||||
'react-i18next': { useTranslation: () => ({ t: (value) => value }) },
|
||||
'../common/table/TableEmpty': TableEmpty,
|
||||
'./ConsoleContext': { useConsolePage: () => ({ page: { key } }) },
|
||||
},
|
||||
);
|
||||
const onChange = () => {};
|
||||
const rows = [{ id: 1 }];
|
||||
const locale = { emptyText: 'custom empty', filterConfirm: 'confirm' };
|
||||
const props = { dataSource: rows, locale, onChange, scroll: { x: 1800 } };
|
||||
const settings = ConsoleTable.render(props, null);
|
||||
assert.equal(settings.props.locale.emptyText.type, TableEmpty);
|
||||
assert.equal(settings.props.locale.filterConfirm, 'confirm');
|
||||
assert.equal(settings.props.dataSource, rows);
|
||||
assert.equal(settings.props.onChange, onChange);
|
||||
assert.equal(settings.props.scroll.x, 1800);
|
||||
key = 'midjourney';
|
||||
assert.equal(
|
||||
ConsoleTable.render(props, null).props.locale.emptyText,
|
||||
'custom empty',
|
||||
);
|
||||
});
|
||||
|
||||
test('console metadata covers every concrete console route without duplicates', () => {
|
||||
const app = readFileSync(new URL('../src/App.jsx', import.meta.url), 'utf8');
|
||||
const routes = [...app.matchAll(/path='(\/console\/[^']+)'/g)]
|
||||
|
||||
Reference in New Issue
Block a user