@@ -22,40 +22,13 @@ describe('DatabaseAlias', () => {
22
22
expect ( render ( < DatabaseAlias { ...mockedProps } /> ) ) . toBeTruthy ( )
23
23
} )
24
24
25
- it ( 'should call onApplyChanges on edit alias' , ( ) => {
26
- const onApply = jest . fn ( )
27
- render ( < DatabaseAlias { ...mockedProps } onApplyChanges = { onApply } /> )
28
-
29
- fireEvent . click ( screen . getByTestId ( 'edit-alias-btn' ) )
30
- fireEvent . change ( screen . getByTestId ( 'alias-input' ) , { target : { value : 'alias' } } )
31
- fireEvent . submit ( screen . getByTestId ( 'alias-input' ) )
32
-
33
- expect ( onApply ) . toHaveBeenCalledWith ( 'alias' , expect . anything ( ) , expect . anything ( ) )
34
- } )
35
-
36
- it ( 'should call onOpen' , ( ) => {
37
- const onOpen = jest . fn ( )
38
- render ( < DatabaseAlias { ...mockedProps } onOpen = { onOpen } /> )
39
-
40
- fireEvent . click ( screen . getByTestId ( 'connect-to-db-btn' ) )
41
- expect ( onOpen ) . toHaveBeenCalled ( )
42
- } )
43
-
44
25
it ( 'should not render part of content in edit mode' , ( ) => {
45
26
render ( < DatabaseAlias { ...mockedProps } isCloneMode = { false } alias = "alias" /> )
46
27
47
28
expect ( screen . queryByTestId ( 'back-btn' ) ) . not . toBeInTheDocument ( )
48
29
expect ( screen . queryByTestId ( 'db-alias' ) ) . toHaveTextContent ( 'alias' )
49
30
} )
50
31
51
- it ( 'should call onCloneBack in clone mode' , ( ) => {
52
- const onCloneBack = jest . fn ( )
53
- render ( < DatabaseAlias { ...mockedProps } onCloneBack = { onCloneBack } isCloneMode /> )
54
-
55
- fireEvent . click ( screen . getByTestId ( 'back-btn' ) )
56
- expect ( onCloneBack ) . toHaveBeenCalled ( )
57
- } )
58
-
59
32
it ( 'should render icon for redis-stack' , ( ) => {
60
33
render ( < DatabaseAlias { ...mockedProps } isRediStack /> )
61
34
0 commit comments