mirror of
https://github.com/langgenius/dify.git
synced 2026-05-09 04:36:31 +08:00
test(web): fix tests of new file uploader
This commit is contained in:
parent
c8d6ad117e
commit
74c4d720d4
@ -26,15 +26,21 @@ export const SelectTrigger = ({
|
||||
children,
|
||||
...props
|
||||
}: React.ButtonHTMLAttributes<HTMLButtonElement> & { children?: ReactNode }) => (
|
||||
<button type="button" {...props}>
|
||||
<button type="button" role="combobox" {...props}>
|
||||
{children}
|
||||
</button>
|
||||
)
|
||||
|
||||
export const SelectValue = ({ placeholder }: { placeholder?: ReactNode }) => <>{placeholder}</>
|
||||
|
||||
export const SelectContent = ({ children }: { children?: ReactNode }) => (
|
||||
<div data-testid="select-content">{children}</div>
|
||||
export const SelectContent = ({
|
||||
children,
|
||||
popupClassName,
|
||||
}: {
|
||||
children?: ReactNode
|
||||
popupClassName?: string
|
||||
}) => (
|
||||
<div data-side="bottom" data-testid="select-content" className={popupClassName}>{children}</div>
|
||||
)
|
||||
|
||||
export const SelectItem = ({
|
||||
|
||||
@ -11,6 +11,7 @@ const mockUploadRemoteFileInfo = vi.fn()
|
||||
|
||||
vi.mock('@/next/navigation', () => ({
|
||||
useParams: () => ({}),
|
||||
usePathname: () => '/',
|
||||
}))
|
||||
|
||||
vi.mock('@/service/common', () => ({
|
||||
|
||||
@ -74,7 +74,7 @@ const TypeSelector: FC<Props> = ({
|
||||
</SelectTrigger>
|
||||
<SelectContent
|
||||
sideOffset={4}
|
||||
popupClassName={cn('w-[432px] rounded-md px-1 py-1 text-base sm:text-sm', popupInnerClassName)}
|
||||
popupClassName={cn('w-(--anchor-width) rounded-md px-1 py-1 text-base sm:text-sm', popupInnerClassName)}
|
||||
listClassName="max-h-80 p-0"
|
||||
>
|
||||
{items.map((item: Item) => (
|
||||
|
||||
@ -29,6 +29,7 @@ vi.mock('../../..', () => ({
|
||||
|
||||
vi.mock('@/next/navigation', () => ({
|
||||
useParams: () => ({ token: 'test-token' }),
|
||||
usePathname: () => '/',
|
||||
}))
|
||||
|
||||
describe('FileUploaderField', () => {
|
||||
|
||||
@ -8,6 +8,7 @@ import { BaseFieldType } from '../types'
|
||||
|
||||
vi.mock('@/next/navigation', () => ({
|
||||
useParams: () => ({}),
|
||||
usePathname: () => '/',
|
||||
}))
|
||||
|
||||
const createConfig = (overrides: Partial<BaseConfiguration> = {}): BaseConfiguration => ({
|
||||
|
||||
@ -38,6 +38,7 @@ vi.mock('@/app/components/workflow/nodes/llm/components/json-schema-config-modal
|
||||
|
||||
vi.mock('@/next/navigation', () => ({
|
||||
useParams: () => ({ token: '' }),
|
||||
usePathname: () => '/',
|
||||
}))
|
||||
|
||||
describe('value-content sections', () => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user