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.

726 B
Raw Blame
import { render } from '@testing-library/react'
import { API_PREFIX } from '@/config'
import BlockIcon from '../block-icon'
import { BlockEnum } from '../types'

describe('BlockIcon', () => {
  it('normalizes protected plugin icon urls for tool-like nodes', () => {
    const { container } = render(
      <BlockIcon
        type={BlockEnum.Tool}
        toolIcon="/foo/workspaces/current/plugin/icon/plugin-tool.png"
      />,
    )

    const iconContainer = container.firstElementChild as HTMLElement
    const backgroundIcon = iconContainer.querySelector('div') as HTMLElement

    expect(backgroundIcon.style.backgroundImage).toContain(
      `${API_PREFIX}/workspaces/current/plugin/icon/plugin-tool.png`,
    )
  })
})