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.

1.3 KB
Raw Blame
import { describe, expect, it } from 'vite-plus/test'
import {
  zDeleteWorkspacesCurrentRbacAccessPoliciesByPolicyIdResponse,
  zDeleteWorkspacesCurrentRbacAgentsByAgentIdAccessPoliciesByPolicyIdMemberBindingsResponse,
  zDeleteWorkspacesCurrentRbacAppsByAppIdAccessPoliciesByPolicyIdMemberBindingsResponse,
  zDeleteWorkspacesCurrentRbacDatasetsByDatasetIdAccessPoliciesByPolicyIdMemberBindingsResponse,
  zDeleteWorkspacesCurrentRbacRolesByRoleIdResponse,
} from './generated/api/console/workspaces/zod.gen.ts'

describe('generated RBAC delete responses', () => {
  it.each([
    ['role', zDeleteWorkspacesCurrentRbacRolesByRoleIdResponse],
    ['policy', zDeleteWorkspacesCurrentRbacAccessPoliciesByPolicyIdResponse],
    [
      'agent member binding',
      zDeleteWorkspacesCurrentRbacAgentsByAgentIdAccessPoliciesByPolicyIdMemberBindingsResponse,
    ],
    [
      'app member binding',
      zDeleteWorkspacesCurrentRbacAppsByAppIdAccessPoliciesByPolicyIdMemberBindingsResponse,
    ],
    [
      'dataset member binding',
      zDeleteWorkspacesCurrentRbacDatasetsByDatasetIdAccessPoliciesByPolicyIdMemberBindingsResponse,
    ],
  ])('validates the %s success payload', (_name, response) => {
    expect(response.parse({ result: 'success' })).toEqual({ result: 'success' })
    expect(response.safeParse({}).success).toBe(false)
  })
})