refactor(ui): 「知识库绑定」改名为「测试知识库绑定」
与新的「生产知识库绑定」(发布 源库→目标库)配对,避免两处同名分不清。 同步改分区标题、说明、错误文案与测试断言。
This commit is contained in:
@@ -58,14 +58,19 @@ describe('SystemSettingsView',()=>{
|
||||
it('lets an administrator bind the internal/external import knowledge bases from 系统设置',()=>{
|
||||
// 组件一直在(RoutingBindingsSection),但从未挂到任何页面 —— 导入目标库只能靠
|
||||
// 部署 env 钉死,换库必须重建容器。
|
||||
const view=(section:'sources'|'bindings')=>renderToStaticMarkup(<AuthContext.Provider value={authValue('admin')}><SystemSettingsView sources={sources} connections={connections} monitor={monitor} settings={settings} productionEnabled={false} routingCapabilities={{internal_enabled:true,external_enabled:true}} loading={false} saving={false} error={null} saveMessage={null} onSave={vi.fn()} onSourcesChanged={vi.fn()} onRefresh={vi.fn()} initialSection={section} /></AuthContext.Provider>)
|
||||
expect(view('sources')).toContain('知识库绑定')
|
||||
const bound=view('bindings')
|
||||
expect(bound).toContain('id="settings-routing-bindings"')
|
||||
expect(bound).toContain('按这里的绑定分发到对应 WeKnora 知识库')
|
||||
// 未读到绑定数据时(SSR 不跑 effect)面板也要如实存在,而不是空白。
|
||||
expect(bound).toContain('读取中…')
|
||||
})
|
||||
const view=(section:'sources'|'bindings'|'production-bindings')=>renderToStaticMarkup(<AuthContext.Provider value={authValue('admin')}><SystemSettingsView sources={sources} connections={connections} monitor={monitor} settings={settings} productionEnabled={false} routingCapabilities={{internal_enabled:true,external_enabled:true}} loading={false} saving={false} error={null} saveMessage={null} onSave={vi.fn()} onSourcesChanged={vi.fn()} onRefresh={vi.fn()} initialSection={section} /></AuthContext.Provider>)
|
||||
expect(view('sources')).toContain('测试知识库绑定')
|
||||
expect(view('sources')).toContain('生产知识库绑定')
|
||||
const bound=view('bindings')
|
||||
expect(bound).toContain('id="settings-routing-bindings"')
|
||||
expect(bound).toContain('分发到对应的测试 WeKnora 知识库')
|
||||
// 未读到绑定数据时(SSR 不跑 effect)面板也要如实存在,而不是空白。
|
||||
expect(bound).toContain('读取中…')
|
||||
// 发布目标(源库 → 目标库)是独立分区,与测试端收件库分开。
|
||||
const target=view('production-bindings')
|
||||
expect(target).toContain('id="settings-production-bindings"')
|
||||
expect(target).toContain('新发布的对内 / 对外内容按这里的绑定写入生产 WeKnora 的对应知识库')
|
||||
})
|
||||
it('does not show healthy simulation when the settings data failed to load',()=>{
|
||||
const html=renderToStaticMarkup(<SystemSettingsView sources={[]} connections={[]} monitor={null} settings={null} productionEnabled={false} routingCapabilities={{internal_enabled:false,external_enabled:false}} loading={false} saving={false} error="加载失败" saveMessage={null} onSave={vi.fn()} onSourcesChanged={vi.fn()} onRefresh={vi.fn()} />)
|
||||
expect(html).toContain('加载失败');expect(html).not.toContain('模拟运行中')
|
||||
|
||||
Reference in New Issue
Block a user