@@ -11,46 +11,40 @@ describe('DatabasePanelDialog', () => {
11
11
expect ( render ( < DatabasePanelDialog { ...instance ( mockedProps ) } /> ) ) . toBeTruthy ( )
12
12
} )
13
13
14
- it ( 'should change tab to manual and render proper form' , ( ) => {
14
+ it ( 'should render proper form by dfeault ' , ( ) => {
15
15
render ( < DatabasePanelDialog { ...instance ( mockedProps ) } isOpen onClose = { jest . fn ( ) } /> )
16
16
17
- fireEvent . click ( screen . getByTestId ( 'add-database_tab_manual' ) )
18
-
19
- expect ( screen . getByTestId ( 'add-db_manual' ) ) . toBeInTheDocument ( )
17
+ expect ( screen . getByTestId ( 'connection-url' ) ) . toBeInTheDocument ( )
20
18
} )
21
19
22
- it ( 'should change tab to cloud and render proper form' , ( ) => {
20
+ it ( 'should change screen to cloud and render proper form' , ( ) => {
23
21
render ( < DatabasePanelDialog { ...instance ( mockedProps ) } isOpen onClose = { jest . fn ( ) } /> )
24
22
25
- fireEvent . click ( screen . getByTestId ( 'add-database_tab_cloud ' ) )
23
+ fireEvent . click ( screen . getByTestId ( 'discover-cloud-btn ' ) )
26
24
27
25
expect ( screen . getByTestId ( 'add-db_cloud-api' ) ) . toBeInTheDocument ( )
28
26
} )
29
27
30
- it ( 'should change tab to software and render proper form' , ( ) => {
28
+ it ( 'should change screen to software and render proper form' , ( ) => {
31
29
render ( < DatabasePanelDialog { ...instance ( mockedProps ) } isOpen onClose = { jest . fn ( ) } /> )
32
30
33
- fireEvent . click ( screen . getByTestId ( 'add-database_tab_software ' ) )
31
+ fireEvent . click ( screen . getByTestId ( 'option-btn-software ' ) )
34
32
35
33
expect ( screen . getByTestId ( 'add-db_cluster' ) ) . toBeInTheDocument ( )
36
34
} )
37
35
38
- it ( 'should change tab to software sentinel and render proper form' , async ( ) => {
36
+ it ( 'should change tab to sentinel and render proper form' , async ( ) => {
39
37
render ( < DatabasePanelDialog { ...instance ( mockedProps ) } isOpen onClose = { jest . fn ( ) } /> )
40
38
41
- fireEvent . click ( screen . getByTestId ( 'add-database_tab_software' ) )
42
-
43
- await act ( async ( ) => {
44
- fireEvent . click ( document . querySelector ( '[data-test-subj="radio-btn-sentinel"] label' ) as Element )
45
- } )
39
+ fireEvent . click ( screen . getByTestId ( 'option-btn-sentinel' ) )
46
40
47
41
expect ( screen . getByTestId ( 'add-db_sentinel' ) ) . toBeInTheDocument ( )
48
42
} )
49
43
50
- it ( 'should change tab to import render proper form' , async ( ) => {
44
+ it ( 'should change screen to import render proper form' , async ( ) => {
51
45
render ( < DatabasePanelDialog { ...instance ( mockedProps ) } isOpen onClose = { jest . fn ( ) } /> )
52
46
53
- fireEvent . click ( screen . getByTestId ( 'add-database_tab_import ' ) )
47
+ fireEvent . click ( screen . getByTestId ( 'option-btn-import ' ) )
54
48
55
49
expect ( screen . getByTestId ( 'add-db_import' ) ) . toBeInTheDocument ( )
56
50
} )
0 commit comments