@@ -14,7 +14,6 @@ import {
1414} from '../../../../store/sqlAnalyze' ;
1515import useOptimizationResult from '../../../SqlOptimization/Result/hooks/useOptimizationResult' ;
1616import { OptimizationSQLDetailStatusEnum } from '@actiontech/shared/lib/api/sqle/service/common.enum' ;
17- import { OptimizationResultStatus } from '../../../SqlOptimization/Result/index.type' ;
1817import { mockReactFlow } from '@actiontech/shared/lib/testUtil/mockModule/mockReactFlow' ;
1918import { optimizationDetailMockData } from '@actiontech/shared/lib/testUtil/mockApi/sqle/sqlOptimization/data' ;
2019
@@ -32,7 +31,6 @@ describe('SqlOptimizationResultDrawer', () => {
3231 useOptimizationResult as jest . MockedFunction < typeof useOptimizationResult > ;
3332
3433 const defaultOptimizationResult = {
35- optimizationResultStatus : OptimizationResultStatus . RESOLVED ,
3634 errorMessage : undefined ,
3735 optimizationResult : optimizationDetailMockData ,
3836 optimizationResultLoading : false ,
@@ -96,40 +94,6 @@ describe('SqlOptimizationResultDrawer', () => {
9694 expect ( baseElement ) . toMatchSnapshot ( ) ;
9795 } ) ;
9896
99- it ( 'should render loading state when optimization is in progress' , ( ) => {
100- mockUseOptimizationResult . mockReturnValue ( {
101- ...defaultOptimizationResult ,
102- optimizationResult : {
103- status : OptimizationSQLDetailStatusEnum . optimizing
104- }
105- } ) ;
106-
107- const { baseElement } = superRender ( < SqlOptimizationResultDrawer /> ) ;
108-
109- expect (
110- screen . getByText ( '优化进行中,预计5-10分钟后完成。感谢您的耐心等待。' )
111- ) . toBeInTheDocument ( ) ;
112- expect (
113- screen . getByText ( '也可进入 快捷诊断-SQL调优 页面追踪进度' )
114- ) . toBeInTheDocument ( ) ;
115- expect ( baseElement ) . toMatchSnapshot ( ) ;
116- } ) ;
117-
118- it ( 'should render error state when optimization failed' , ( ) => {
119- mockUseOptimizationResult . mockReturnValue ( {
120- ...defaultOptimizationResult ,
121- optimizationResult : {
122- status : OptimizationSQLDetailStatusEnum . failed ,
123- status_detail : '优化失败的详细信息'
124- }
125- } ) ;
126-
127- const { baseElement } = superRender ( < SqlOptimizationResultDrawer /> ) ;
128-
129- expect ( screen . getByText ( '优化失败的详细信息' ) ) . toBeInTheDocument ( ) ;
130- expect ( baseElement ) . toMatchSnapshot ( ) ;
131- } ) ;
132-
13397 it ( 'should dispatch close actions when drawer is closed' , ( ) => {
13498 superRender ( < SqlOptimizationResultDrawer /> ) ;
13599
0 commit comments