{{ t('knowledge.paragraph.relatedQuestions.label') }}
diff --git a/ui/src/views/knowledge-detail/library/document/upload-document/EditParagraphDialog.vue b/ui/src/views/knowledge-detail/library/document/upload-document/EditParagraphDialog.vue
index 156c5b1b239..86c960bb303 100644
--- a/ui/src/views/knowledge-detail/library/document/upload-document/EditParagraphDialog.vue
+++ b/ui/src/views/knowledge-detail/library/document/upload-document/EditParagraphDialog.vue
@@ -83,7 +83,7 @@ defineExpose({ open, close })
diff --git a/ui/tests/dingtalk-auth-code.test.mjs b/ui/tests/dingtalk-auth-code.test.mjs
deleted file mode 100644
index 8d2742a6a80..00000000000
--- a/ui/tests/dingtalk-auth-code.test.mjs
+++ /dev/null
@@ -1,51 +0,0 @@
-import assert from 'node:assert/strict'
-import { readFileSync } from 'node:fs'
-import { test } from 'node:test'
-import { compileFunction } from 'node:vm'
-import ts from 'typescript'
-
-function loadModule(path) {
- const { outputText } = ts.transpileModule(readFileSync(new URL(`../src/${path}.ts`, import.meta.url), 'utf8'), {
- compilerOptions: { module: ts.ModuleKind.CommonJS, target: ts.ScriptTarget.ES2022 },
- })
- const exports = {}
- compileFunction(outputText, ['require', 'exports'])(() => {
- throw new Error('Unexpected dependency')
- }, exports)
- return exports
-}
-
-test('相同钉钉授权码只执行一次完整登录流程', async () => {
- const { createAuthCodeHandler } = loadModule('views/login/scanComponents/dingtalkAuthCode')
- const calls = []
- const handleAuthCode = createAuthCodeHandler(
- async (authCode) => {
- calls.push(`login:${authCode}`)
- await Promise.resolve()
- return true
- },
- async () => {
- calls.push('success')
- },
- )
-
- await Promise.all([handleAuthCode('same-auth-code'), handleAuthCode('same-auth-code')])
- await handleAuthCode('next-auth-code')
-
- assert.deepEqual(calls, ['login:same-auth-code', 'success', 'login:next-auth-code', 'success'])
-})
-
-test('没有登录 token 时不执行成功跳转', async () => {
- const { createAuthCodeHandler } = loadModule('views/login/scanComponents/dingtalkAuthCode')
- let successCalls = 0
- const handleAuthCode = createAuthCodeHandler(
- async () => false,
- async () => {
- successCalls += 1
- },
- )
-
- await handleAuthCode('expired-auth-code')
-
- assert.equal(successCalls, 0)
-})
diff --git a/ui/tests/document-strategy-workspace.html b/ui/tests/document-strategy-workspace.html
deleted file mode 100644
index 39c02c38ec1..00000000000
--- a/ui/tests/document-strategy-workspace.html
+++ /dev/null
@@ -1,96 +0,0 @@
-
-
-Document strategy workspace options
-
-
diff --git a/ui/tests/login-manual-mode.test.mjs b/ui/tests/login-manual-mode.test.mjs
deleted file mode 100644
index 071244cfa1d..00000000000
--- a/ui/tests/login-manual-mode.test.mjs
+++ /dev/null
@@ -1,158 +0,0 @@
-import assert from 'node:assert/strict'
-import { readFileSync } from 'node:fs'
-import { test } from 'node:test'
-import { compileFunction } from 'node:vm'
-import ts from 'typescript'
-
-function loadModule(path, dependencies = {}) {
- const { outputText } = ts.transpileModule(readFileSync(new URL(`../src/${path}.ts`, import.meta.url), 'utf8'), {
- compilerOptions: { module: ts.ModuleKind.CommonJS, target: ts.ScriptTarget.ES2022 },
- })
- const exports = {}
- compileFunction(outputText, ['require', 'exports'])((id) => {
- assert.ok(Object.hasOwn(dependencies, id), `Unexpected dependency: ${id}`)
- return dependencies[id]
- }, exports)
- return exports
-}
-
-const loadLoginConstants = () =>
- loadModule('views/login/constants', {
- '@/api/enums': {
- LOGIN_METHOD: {
- CAS: 'CAS',
- DINGTALK: 'dingtalk',
- LARK: 'lark',
- LDAP: 'LDAP',
- LOCAL: 'LOCAL',
- OAUTH2: 'OAuth2',
- OIDC: 'OIDC',
- SAML2: 'SAML2',
- WECOM: 'wecom',
- },
- },
- })
-
-test('扫码为唯一登录方式时手动登录地址仍选择账号登录', () => {
- const { resolveLoginMode } = loadLoginConstants()
-
- assert.equal(resolveLoginMode('dingtalk', 'manual'), 'account')
-})
-
-test('未携带手动登录参数时保留扫码默认方式', () => {
- const { resolveLoginMode } = loadLoginConstants()
-
- assert.equal(resolveLoginMode('dingtalk', undefined), 'qr-code')
-})
-
-test('手动登录页仍显示扫码切换入口', () => {
- const { shouldShowLoginModeSwitch } = loadLoginConstants()
-
- assert.equal(shouldShowLoginModeSwitch(false, true, 'manual'), true)
-})
-
-test('普通扫码页不显示无账号方式的登录切换入口', () => {
- const { shouldShowLoginModeSwitch } = loadLoginConstants()
-
- assert.equal(shouldShowLoginModeSwitch(false, true, undefined), false)
-})
-
-test('对话手动登录未勾选账号密码时不补回 LOCAL', () => {
- const { resolveAccountLoginMethods } = loadLoginConstants()
-
- assert.deepEqual(resolveAccountLoginMethods(['OIDC'], true, false), ['OIDC'])
-})
-
-test('系统手动登录仍补回 LOCAL', () => {
- const { resolveAccountLoginMethods } = loadLoginConstants()
-
- assert.deepEqual(resolveAccountLoginMethods(['OIDC'], true, true), ['LOCAL', 'OIDC'])
-})
-
-test('对话手动登录勾选账号密码时保留 LOCAL', () => {
- const { resolveAccountLoginMethods } = loadLoginConstants()
-
- assert.deepEqual(resolveAccountLoginMethods(['LOCAL', 'OIDC'], true, false), ['LOCAL', 'OIDC'])
-})
-
-test('对话手动登录未勾选账号密码时不默认选择 LOCAL 表单', () => {
- const { resolveInitialAccountLoginMethod } = loadLoginConstants()
-
- assert.equal(resolveInitialAccountLoginMethod(['OIDC'], 'OIDC', true, false), 'OIDC')
-})
-
-test('对话手动登录仅对 LOCAL 和 LDAP 展示账号密码表单', () => {
- const { shouldShowAccountLoginForm } = loadLoginConstants()
-
- assert.equal(shouldShowAccountLoginForm('OIDC'), false)
- assert.equal(shouldShowAccountLoginForm('LDAP'), true)
- assert.equal(shouldShowAccountLoginForm('LOCAL'), true)
-})
-
-test('手动账号登录请求携带 manual 登录标记', () => {
- const { buildAccountLoginRequest } = loadLoginConstants()
-
- assert.deepEqual(buildAccountLoginRequest('admin', 'encrypted', true), {
- encryptedData: 'encrypted',
- login_mode: 'manual',
- username: 'admin',
- })
-})
-
-test('普通账号登录请求不携带 manual 登录标记', () => {
- const { buildAccountLoginRequest } = loadLoginConstants()
-
- assert.deepEqual(buildAccountLoginRequest('local-user', 'encrypted', false), {
- encryptedData: 'encrypted',
- username: 'local-user',
- })
-})
-
-test('默认登录方式为免密认证时登出进入手动账号登录页', () => {
- const { resolveLogoutLoginRoute } = loadLoginConstants()
-
- for (const loginMethod of ['CAS', 'OIDC', 'OAuth2', 'SAML2']) {
- assert.deepEqual(resolveLogoutLoginRoute(loginMethod), {
- name: 'login',
- query: { login_mode: 'manual' },
- })
- }
-})
-
-test('默认登录方式不是免密认证时登出进入系统默认登录页', () => {
- const { resolveLogoutLoginRoute } = loadLoginConstants()
-
- for (const loginMethod of ['LOCAL', 'LDAP', 'dingtalk', 'lark', 'wecom']) {
- assert.deepEqual(resolveLogoutLoginRoute(loginMethod), { name: 'login' })
- }
-})
-
-test('对话用户使用免密默认登录时退出进入手动登录页', () => {
- const { resolveChatLogoutLoginRoute } = loadLoginConstants()
-
- for (const loginMethod of ['CAS', 'OIDC', 'OAuth2', 'SAML2']) {
- assert.deepEqual(resolveChatLogoutLoginRoute(loginMethod, false, 'application-token'), {
- name: 'chat-login',
- params: { accessToken: 'application-token' },
- query: { login_mode: 'manual' },
- })
- assert.deepEqual(resolveChatLogoutLoginRoute(loginMethod, true, undefined), {
- name: 'portal-login',
- query: { login_mode: 'manual' },
- })
- }
-})
-
-test('对话用户使用非免密默认登录时退出进入系统默认登录页', () => {
- const { resolveChatLogoutLoginRoute } = loadLoginConstants()
-
- for (const loginMethod of ['LOCAL', 'LDAP', 'dingtalk', 'lark', 'wecom']) {
- assert.deepEqual(resolveChatLogoutLoginRoute(loginMethod, false, 'application-token'), {
- name: 'chat-login',
- params: { accessToken: 'application-token' },
- })
- assert.deepEqual(resolveChatLogoutLoginRoute(loginMethod, true, undefined), {
- name: 'portal-login',
- })
- }
-})
diff --git a/ui/tests/tool-export.test.mjs b/ui/tests/tool-export.test.mjs
deleted file mode 100644
index a09c0751c96..00000000000
--- a/ui/tests/tool-export.test.mjs
+++ /dev/null
@@ -1,34 +0,0 @@
-import assert from 'node:assert/strict'
-import { readFileSync } from 'node:fs'
-import { test } from 'node:test'
-import { parse } from '@vue/compiler-sfc'
-import { compile, createSSRApp, h } from 'vue'
-import { renderToString } from 'vue/server-renderer'
-
-const source = readFileSync(new URL('../src/views/tool/index.vue', import.meta.url), 'utf8')
-const { template } = parse(source).descriptor
-function findExportAction(node) {
- if (node.tag === 'ExportToolAction') return node
- return node.children?.map(findExportAction).find(Boolean)
-}
-const render = compile(findExportAction(template.ast).loc.source)
-
-test('工具导出菜单按当前工具权限显示,覆盖手工创建和商店安装', async () => {
- for (const templateId of [null, 'store-template']) {
- for (const allowed of [false, true]) {
- const tool = { id: 'installed-tool', template_id: templateId }
- const app = createSSRApp({
- setup: () => ({
- tool,
- ToolApi: {},
- toolOperationLoading: false,
- t: (key) => key,
- perm: { tool: { workspace: { export: (id) => id === tool.id && allowed } } },
- }),
- render,
- })
- app.component('ExportToolAction', () => h('button', 'export'))
- assert.equal((await renderToString(app)).includes('>export'), allowed)
- }
- }
-})
diff --git a/ui/tests/upload-folder.html b/ui/tests/upload-folder.html
deleted file mode 100644
index da22065aff8..00000000000
--- a/ui/tests/upload-folder.html
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-Mixed folder upload regression
-
-