mirror of
https://github.com/langgenius/dify.git
synced 2026-09-21 05:11:22 +08:00
refactor(web): move education verification to dedicated routes (#40493)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -2,6 +2,7 @@ import type {
|
||||
EducationStatusResponse,
|
||||
GetAccountProfileResponse,
|
||||
} from '@dify/contracts/api/console/account/types.gen'
|
||||
import type { GetFeaturesResponse } from '@dify/contracts/api/console/features/types.gen'
|
||||
import type {
|
||||
GetSystemFeaturesLicenseResponse,
|
||||
GetSystemFeaturesResponse,
|
||||
@@ -16,6 +17,7 @@ import type {
|
||||
} from '@testing-library/react'
|
||||
import type { ReactElement, ReactNode } from 'react'
|
||||
import type { DeepPartial } from '@/test/console/system-features'
|
||||
import { zGetFeaturesResponse } from '@dify/contracts/api/console/features/zod.gen'
|
||||
import { render, renderHook } from '@testing-library/react'
|
||||
import { consoleQuery } from '@/service/client'
|
||||
import { ensureAccountProfileQuery, seedAccountProfileQuery } from '@/test/console/account-profile'
|
||||
@@ -122,6 +124,15 @@ export const seedEducationStatus = (
|
||||
return data
|
||||
}
|
||||
|
||||
export const seedFeatures = (
|
||||
queryClient: QueryClient,
|
||||
overrides: DeepPartial<GetFeaturesResponse> = {},
|
||||
): GetFeaturesResponse => {
|
||||
const data = zGetFeaturesResponse.parse(overrides)
|
||||
queryClient.setQueryData(consoleQuery.features.get.queryKey(), data)
|
||||
return data
|
||||
}
|
||||
|
||||
const ensureSystemFeatures = (queryClient: QueryClient) => {
|
||||
const queryKey = consoleQuery.systemFeatures.get.queryKey()
|
||||
const existingSystemFeatures = queryClient.getQueryData<GetSystemFeaturesResponse>(queryKey)
|
||||
|
||||
Reference in New Issue
Block a user