dify/web/__tests__/proxy-frame-options.spec.ts
盐粒 Yanli 52c106b532
feat(agent-v2): sync nightly updates to main (2026-06-25) (#37915)
Co-authored-by: Joel <iamjoel007@gmail.com>
Co-authored-by: yyh <yuanyouhuilyz@gmail.com>
Co-authored-by: Yansong Zhang <916125788@qq.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-06-26 13:13:35 +00:00

21 lines
798 B
TypeScript

import { describe, expect, it } from 'vitest'
import { canEmbedPath } from '@/proxy'
describe('proxy frame options', () => {
it('should allow embedded share routes', () => {
expect(canEmbedPath('/chatbot/token')).toBe(true)
expect(canEmbedPath('/workflow/token')).toBe(true)
expect(canEmbedPath('/completion/token')).toBe(true)
expect(canEmbedPath('/webapp-signin')).toBe(true)
expect(canEmbedPath('/agent/token')).toBe(true)
})
it('should deny non-embedded console routes by default', () => {
expect(canEmbedPath('/agents')).toBe(false)
expect(canEmbedPath('/agent-settings')).toBe(false)
expect(canEmbedPath('/agentic')).toBe(false)
expect(canEmbedPath('/roster/agent/agent-1/access')).toBe(false)
expect(canEmbedPath('/apps')).toBe(false)
})
})