refactor(web): extract custom hooks from complex components and add comprehensive tests (#32301)

Co-authored-by: CodingOnStar <hanxujiang@dify.com>
This commit is contained in:
Coding On Star
2026-02-13 17:21:34 +08:00
committed by GitHub
parent 98466e2d29
commit 210710e76d
21 changed files with 2595 additions and 983 deletions

View File

@@ -277,7 +277,10 @@ describe('App Card Operations Flow', () => {
}
})
// -- Basic rendering --
afterEach(() => {
vi.restoreAllMocks()
})
describe('Card Rendering', () => {
it('should render app name and description', () => {
renderAppCard({ name: 'My AI Bot', description: 'An intelligent assistant' })

View File

@@ -187,7 +187,10 @@ describe('App List Browsing Flow', () => {
mockShowTagManagementModal = false
})
// -- Loading and Empty states --
afterEach(() => {
vi.restoreAllMocks()
})
describe('Loading and Empty States', () => {
it('should show skeleton cards during initial loading', () => {
mockIsLoading = true

View File

@@ -237,7 +237,6 @@ describe('Create App Flow', () => {
mockShowTagManagementModal = false
})
// -- NewAppCard rendering --
describe('NewAppCard Rendering', () => {
it('should render the "Create App" card with all options', () => {
renderList()