File tree Expand file tree Collapse file tree 1 file changed +5
-11
lines changed
redisinsight/ui/src/components/import-databases-dialog Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -92,31 +92,25 @@ describe('ImportDatabasesDialog', () => {
92
92
expect ( screen . getByTestId ( 'file-loading-indicator' ) ) . toBeInTheDocument ( )
93
93
} )
94
94
95
- it ( 'should render success message when at least 1 database added ' , ( ) => {
95
+ it ( 'should not render error message without error ' , ( ) => {
96
96
( importInstancesSelector as jest . Mock ) . mockImplementation ( ( ) => ( {
97
97
loading : false ,
98
- data : {
99
- success : 1 ,
100
- total : 2
101
- }
98
+ data : { }
102
99
} ) )
103
100
104
101
render ( < ImportDatabasesDialog onClose = { jest . fn ( ) } /> )
105
- expect ( screen . getByTestId ( 'result-success' ) ) . toBeInTheDocument ( )
106
102
expect ( screen . queryByTestId ( 'result-failed' ) ) . not . toBeInTheDocument ( )
107
103
} )
108
104
109
105
it ( 'should render error message when 0 success databases added' , ( ) => {
110
106
( importInstancesSelector as jest . Mock ) . mockImplementation ( ( ) => ( {
111
107
loading : false ,
112
- data : {
113
- success : 0 ,
114
- total : 2
115
- }
108
+ data : null ,
109
+ error : 'Error message'
116
110
} ) )
117
111
118
112
render ( < ImportDatabasesDialog onClose = { jest . fn ( ) } /> )
119
113
expect ( screen . getByTestId ( 'result-failed' ) ) . toBeInTheDocument ( )
120
- expect ( screen . queryByTestId ( 'result-success ' ) ) . not . toBeInTheDocument ( )
114
+ expect ( screen . getByTestId ( 'result-failed ' ) ) . toHaveTextContent ( 'Error message' )
121
115
} )
122
116
} )
You can’t perform that action at this time.
0 commit comments