Files
gsfdc/demo-dify/dify/web/config/index.spec.ts
T
wuzilongandCursor 6519682885 chore: 纳入本地 Dify 1.19.0 源码及品牌与免登改动
演示目录只保留可重建的源码。运行密钥、数据卷、依赖和带口令的本地配置不进入仓库。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-18 13:59:25 +08:00

33 lines
849 B
TypeScript

import { resetReg, validPassword, VAR_REGEX } from './index'
it.each([
['abc12345', true],
['ABC12345', true],
['p@$$w0rd', true],
['abc1234', false],
['12345678', false],
['abcdefgh', false],
['pass word1', false],
['password1 ', false],
['pass\tword1', false],
])('checks the password policy for %s', (password, valid) => {
expect(validPassword.test(password)).toBe(valid)
})
describe('workflow variable references', () => {
beforeEach(() => resetReg())
afterEach(() => resetReg())
it.each([
'{{#1749783300519.text#}}',
'{{#1749783300519.llm.a.b.c#}}',
'{{#sys.query#}}',
'{{#conversation.aaa#}}',
'{{#env.a#}}',
'{{#rag.1748945155129.a#}}',
'{{#rag.shared.bbb#}}',
])('matches the complete %s reference', (variable) => {
expect(variable.match(VAR_REGEX)).toEqual([variable])
})
})