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.

874 B
Raw Blame
import { screen } from '@testing-library/react'
import { renderWithConsoleQuery } from '@/test/console/query-data'
import EnvNav from '../index'

const renderEnvNav = (currentEnv: string) =>
  renderWithConsoleQuery(<EnvNav />, {
    accountProfileMeta: { currentEnv },
  })

describe('EnvNav', () => {
  it('should render null when environment is PRODUCTION', () => {
    const { container } = renderEnvNav('PRODUCTION')
    expect(container.firstChild).toBeNull()
  })

  it('should render TESTING tag and icon when environment is TESTING', () => {
    renderEnvNav('TESTING')
    expect(screen.getByText('common.environment.testing')).toBeInTheDocument()
  })

  it('should render DEVELOPMENT tag and icon when environment is DEVELOPMENT', () => {
    renderEnvNav('DEVELOPMENT')
    expect(screen.getByText('common.environment.development')).toBeInTheDocument()
  })
})