mirror of
https://github.com/langgenius/dify.git
synced 2026-05-03 08:58:09 +08:00
use base ui toast
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import { cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react'
|
||||
import * as React from 'react'
|
||||
import Toast from '@/app/components/base/toast'
|
||||
import { toast } from '@/app/components/base/ui/toast'
|
||||
import BlockInput, { getInputKeys } from '../index'
|
||||
|
||||
vi.mock('@/utils/var', () => ({
|
||||
@ -14,7 +14,7 @@ vi.mock('@/utils/var', () => ({
|
||||
describe('BlockInput', () => {
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks()
|
||||
vi.spyOn(Toast, 'notify')
|
||||
vi.spyOn(toast, 'error').mockReturnValue('toast-error')
|
||||
cleanup()
|
||||
})
|
||||
|
||||
@ -138,7 +138,7 @@ describe('BlockInput', () => {
|
||||
fireEvent.change(textarea, { target: { value: '{{invalid}}' } })
|
||||
|
||||
await waitFor(() => {
|
||||
expect(Toast.notify).toHaveBeenCalled()
|
||||
expect(toast.error).toHaveBeenCalled()
|
||||
})
|
||||
expect(onConfirm).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user