test: add integration tests for app card operations, list browsing, and create app flows (#32298)

Co-authored-by: CodingOnStar <hanxujiang@dify.com>
This commit is contained in:
Coding On Star
2026-02-13 13:21:09 +08:00
committed by GitHub
parent 84d090db33
commit a4e03d6284
17 changed files with 1509 additions and 359 deletions

View File

@ -4,9 +4,6 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import TryApp from '../index'
import { TypeEnum } from '../tab'
// Suppress expected React act() warnings from internal async state updates
vi.spyOn(console, 'error').mockImplementation(() => {})
vi.mock('@/config', async (importOriginal) => {
const actual = await importOriginal() as object
return {
@ -91,6 +88,9 @@ const createMockAppDetail = (mode: string = 'chat'): TryAppInfo => ({
describe('TryApp (main index.tsx)', () => {
beforeEach(() => {
vi.clearAllMocks()
// Suppress expected React act() warnings from internal async state updates
vi.spyOn(console, 'error').mockImplementation(() => {})
mockUseGetTryAppInfo.mockReturnValue({
data: createMockAppDetail(),
isLoading: false,
@ -99,7 +99,7 @@ describe('TryApp (main index.tsx)', () => {
afterEach(() => {
cleanup()
vi.clearAllMocks()
vi.restoreAllMocks()
})
describe('loading state', () => {