Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

932 B
Raw Blame
import {
  isAccountSettingDestination,
  isIntegrationSettingDestination,
  settingsQueryParser,
} from '../query-params'

describe('settingsQueryParser', () => {
  it.each([
    ['roles-and-permissions', 'roles-and-permissions'],
    ['ip-policies', 'ip-policies'],
    ['access-token', 'access-token'],
    ['preferences', 'preferences'],
    ['provider', 'provider'],
    ['mcp', 'mcp'],
    ['agent-strategy', 'agent-strategy'],
    ['invalid', null],
    ['', null],
  ])('parses %s', (value, expected) => {
    expect(settingsQueryParser.parse(value)).toBe(expected)
  })

  it('keeps account and integration destinations in their owning branches', () => {
    expect(isAccountSettingDestination('members')).toBe(true)
    expect(isAccountSettingDestination('provider')).toBe(false)
    expect(isIntegrationSettingDestination('provider')).toBe(true)
    expect(isIntegrationSettingDestination('members')).toBe(false)
  })
})