mirror of
https://github.com/langgenius/dify.git
synced 2026-04-21 19:27:40 +08:00
Made-with: Cursor # Conflicts: # api/core/agent/cot_chat_agent_runner.py # api/core/agent/fc_agent_runner.py # api/core/memory/token_buffer_memory.py # api/core/variables/segments.py # api/core/workflow/file/file_manager.py # api/core/workflow/nodes/agent/agent_node.py # api/core/workflow/nodes/llm/llm_utils.py # api/core/workflow/nodes/parameter_extractor/parameter_extractor_node.py # api/core/workflow/workflow_entry.py # api/factories/variable_factory.py # api/pyproject.toml # api/services/variable_truncator.py # api/uv.lock # web/app/components/app/app-publisher/index.tsx # web/app/components/app/overview/settings/index.tsx # web/app/components/apps/app-card.tsx # web/app/components/apps/index.tsx # web/app/components/apps/list.tsx # web/app/components/base/chat/chat-with-history/header-in-mobile.tsx # web/app/components/base/features/new-feature-panel/conversation-opener/modal.tsx # web/app/components/base/features/new-feature-panel/file-upload/setting-content.tsx # web/app/components/base/features/new-feature-panel/moderation/moderation-setting-modal.tsx # web/app/components/base/features/new-feature-panel/text-to-speech/param-config-content.tsx # web/app/components/base/message-log-modal/index.tsx # web/app/components/base/switch/index.tsx # web/app/components/base/tab-slider-plain/index.tsx # web/app/components/explore/try-app/app-info/index.tsx # web/app/components/plugins/plugin-detail-panel/tool-selector/components/reasoning-config-form.tsx # web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/edit-card/required-switch.tsx # web/app/components/workflow/nodes/llm/panel.tsx # web/contract/router.ts # web/eslint-suppressions.json # web/i18n/fa-IR/workflow.json
45 lines
1.8 KiB
TypeScript
45 lines
1.8 KiB
TypeScript
import {
|
|
ACCOUNT_SETTING_MODAL_ACTION,
|
|
ACCOUNT_SETTING_TAB,
|
|
DEFAULT_ACCOUNT_SETTING_TAB,
|
|
isValidAccountSettingTab,
|
|
} from './constants'
|
|
|
|
describe('AccountSetting Constants', () => {
|
|
it('should have correct ACCOUNT_SETTING_MODAL_ACTION', () => {
|
|
expect(ACCOUNT_SETTING_MODAL_ACTION).toBe('showSettings')
|
|
})
|
|
|
|
it('should have correct ACCOUNT_SETTING_TAB values', () => {
|
|
expect(ACCOUNT_SETTING_TAB.SANDBOX_PROVIDER).toBe('sandbox-provider')
|
|
expect(ACCOUNT_SETTING_TAB.MODEL_PROVIDER).toBe('model-provider')
|
|
expect(ACCOUNT_SETTING_TAB.MEMBERS).toBe('members')
|
|
expect(ACCOUNT_SETTING_TAB.BILLING).toBe('billing')
|
|
expect(ACCOUNT_SETTING_TAB.DATA_SOURCE).toBe('data-source')
|
|
expect(ACCOUNT_SETTING_TAB.API_BASED_EXTENSION).toBe('api-based-extension')
|
|
expect(ACCOUNT_SETTING_TAB.CUSTOM).toBe('custom')
|
|
expect(ACCOUNT_SETTING_TAB.LANGUAGE).toBe('language')
|
|
})
|
|
|
|
it('should have correct DEFAULT_ACCOUNT_SETTING_TAB', () => {
|
|
expect(DEFAULT_ACCOUNT_SETTING_TAB).toBe(ACCOUNT_SETTING_TAB.MEMBERS)
|
|
})
|
|
|
|
it('isValidAccountSettingTab should return true for valid tabs', () => {
|
|
expect(isValidAccountSettingTab('sandbox-provider')).toBe(true)
|
|
expect(isValidAccountSettingTab('model-provider')).toBe(true)
|
|
expect(isValidAccountSettingTab('members')).toBe(true)
|
|
expect(isValidAccountSettingTab('billing')).toBe(true)
|
|
expect(isValidAccountSettingTab('data-source')).toBe(true)
|
|
expect(isValidAccountSettingTab('api-based-extension')).toBe(true)
|
|
expect(isValidAccountSettingTab('custom')).toBe(true)
|
|
expect(isValidAccountSettingTab('language')).toBe(true)
|
|
})
|
|
|
|
it('isValidAccountSettingTab should return false for invalid tabs', () => {
|
|
expect(isValidAccountSettingTab(null)).toBe(false)
|
|
expect(isValidAccountSettingTab('')).toBe(false)
|
|
expect(isValidAccountSettingTab('invalid')).toBe(false)
|
|
})
|
|
})
|