@@ -43,7 +43,6 @@ const dataShim = {
43
43
} ;
44
44
45
45
describe ( 'TopNavMenu' , ( ) => {
46
- const WRAPPER_SELECTOR = '.osdTopNavMenu__wrapper' ;
47
46
const TOP_NAV_ITEM_SELECTOR = 'TopNavMenuItem' ;
48
47
const SEARCH_BAR_SELECTOR = 'SearchBar' ;
49
48
const menuItems : TopNavMenuData [ ] = [
@@ -66,28 +65,24 @@ describe('TopNavMenu', () => {
66
65
67
66
it ( 'Should render nothing when no config is provided' , ( ) => {
68
67
const component = shallowWithIntl ( < TopNavMenu appName = { 'test' } /> ) ;
69
- expect ( component . find ( WRAPPER_SELECTOR ) . length ) . toBe ( 0 ) ;
70
68
expect ( component . find ( TOP_NAV_ITEM_SELECTOR ) . length ) . toBe ( 0 ) ;
71
69
expect ( component . find ( SEARCH_BAR_SELECTOR ) . length ) . toBe ( 0 ) ;
72
70
} ) ;
73
71
74
72
it ( 'Should not render menu items when config is empty' , ( ) => {
75
73
const component = shallowWithIntl ( < TopNavMenu appName = { 'test' } config = { [ ] } /> ) ;
76
- expect ( component . find ( WRAPPER_SELECTOR ) . length ) . toBe ( 0 ) ;
77
74
expect ( component . find ( TOP_NAV_ITEM_SELECTOR ) . length ) . toBe ( 0 ) ;
78
75
expect ( component . find ( SEARCH_BAR_SELECTOR ) . length ) . toBe ( 0 ) ;
79
76
} ) ;
80
77
81
78
it ( 'Should render 1 menu item' , ( ) => {
82
79
const component = shallowWithIntl ( < TopNavMenu appName = { 'test' } config = { [ menuItems [ 0 ] ] } /> ) ;
83
- expect ( component . find ( WRAPPER_SELECTOR ) . length ) . toBe ( 1 ) ;
84
80
expect ( component . find ( TOP_NAV_ITEM_SELECTOR ) . length ) . toBe ( 1 ) ;
85
81
expect ( component . find ( SEARCH_BAR_SELECTOR ) . length ) . toBe ( 0 ) ;
86
82
} ) ;
87
83
88
84
it ( 'Should render multiple menu items' , ( ) => {
89
85
const component = shallowWithIntl ( < TopNavMenu appName = { 'test' } config = { menuItems } /> ) ;
90
- expect ( component . find ( WRAPPER_SELECTOR ) . length ) . toBe ( 1 ) ;
91
86
expect ( component . find ( TOP_NAV_ITEM_SELECTOR ) . length ) . toBe ( menuItems . length ) ;
92
87
expect ( component . find ( SEARCH_BAR_SELECTOR ) . length ) . toBe ( 0 ) ;
93
88
} ) ;
@@ -96,7 +91,6 @@ describe('TopNavMenu', () => {
96
91
const component = shallowWithIntl (
97
92
< TopNavMenu appName = { 'test' } showSearchBar = { true } data = { dataShim as any } />
98
93
) ;
99
- expect ( component . find ( WRAPPER_SELECTOR ) . length ) . toBe ( 1 ) ;
100
94
expect ( component . find ( TOP_NAV_ITEM_SELECTOR ) . length ) . toBe ( 0 ) ;
101
95
expect ( component . find ( SEARCH_BAR_SELECTOR ) . length ) . toBe ( 1 ) ;
102
96
} ) ;
@@ -105,7 +99,6 @@ describe('TopNavMenu', () => {
105
99
const component = shallowWithIntl (
106
100
< TopNavMenu appName = { 'test' } config = { menuItems } showSearchBar = { true } data = { dataShim as any } />
107
101
) ;
108
- expect ( component . find ( WRAPPER_SELECTOR ) . length ) . toBe ( 1 ) ;
109
102
expect ( component . find ( TOP_NAV_ITEM_SELECTOR ) . length ) . toBe ( menuItems . length ) ;
110
103
expect ( component . find ( SEARCH_BAR_SELECTOR ) . length ) . toBe ( 1 ) ;
111
104
} ) ;
@@ -170,7 +163,6 @@ describe('TopNavMenu', () => {
170
163
171
164
await refresh ( ) ;
172
165
173
- expect ( component . find ( WRAPPER_SELECTOR ) . length ) . toBe ( 1 ) ;
174
166
expect ( component . find ( SEARCH_BAR_SELECTOR ) . length ) . toBe ( 1 ) ;
175
167
176
168
// menu is rendered outside of the component
0 commit comments