@@ -23,7 +23,7 @@ const POLICY = SecurityPolicy.create(policyJSON);
2323const ROLES = processGetRolesResponse ( rolesJSON . roles ) ;
2424const ROLES_BY_NAME = getRolesByUniqueName ( ROLES ) ;
2525
26- describe ( '< UsersGridPanel/> ' , ( ) => {
26+ describe ( 'UsersGridPanel' , ( ) => {
2727 const DEFAULT_PROPS = {
2828 container : TEST_PROJECT_CONTAINER_ADMIN ,
2929 user : TEST_USER_APP_ADMIN ,
@@ -73,6 +73,8 @@ describe('<UsersGridPanel/>', () => {
7373 expect ( buttons ) . toHaveLength ( 4 ) ;
7474 expect ( buttons [ 0 ] . textContent ) . toBe ( 'Create' ) ;
7575 expect ( buttons [ 1 ] . textContent ) . toBe ( 'Manage' ) ;
76+ expect ( buttons [ 2 ] . textContent ) . toBe ( ' Filters' ) ;
77+ expect ( buttons [ 3 ] . textContent ) . toBe ( 'Filters' ) ;
7678 expect ( document . querySelectorAll ( '.dropdown-toggle' ) [ 0 ] . textContent . trim ( ) ) . toEqual ( 'Manage' ) ;
7779
7880 const menuItems = document . querySelectorAll ( '.lk-menu-item' ) ;
@@ -93,8 +95,13 @@ describe('<UsersGridPanel/>', () => {
9395 const buttons = document . querySelectorAll ( '.grid-panel__button-bar-left button' ) ;
9496 expect ( buttons ) . toHaveLength ( 3 ) ;
9597 expect ( buttons [ 0 ] . textContent ) . toBe ( 'Create' ) ;
98+ expect ( buttons [ 1 ] . textContent ) . toBe ( ' Filters' ) ;
99+ expect ( buttons [ 2 ] . textContent ) . toBe ( 'Filters' ) ;
96100 // no Manage dropdown without manage users permission
97- expect ( document . querySelectorAll ( '.dropdown-toggle' ) [ 0 ] . textContent . trim ( ) ) . not . toEqual ( 'Manage' ) ;
101+ const dropdowns = document . querySelectorAll ( '.dropdown-toggle' ) ;
102+ expect ( dropdowns ) . toHaveLength ( 2 ) ;
103+ expect ( dropdowns [ 0 ] . textContent ) . toBe ( 'Export' ) ;
104+ expect ( dropdowns [ 1 ] . textContent ) . toBe ( ' Views' ) ;
98105
99106 const menuItems = document . querySelectorAll ( '.lk-menu-item' ) ;
100107 expect ( menuItems ) . toHaveLength ( 6 ) ;
@@ -109,8 +116,8 @@ describe('<UsersGridPanel/>', () => {
109116 expect ( document . querySelectorAll ( '.view-header' ) [ 0 ] . textContent ) . toBe ( 'Application Users' ) ;
110117 const buttons = document . querySelectorAll ( '.grid-panel__button-bar-left button' ) ;
111118 expect ( buttons ) . toHaveLength ( 2 ) ;
112- expect ( buttons [ 0 ] . textContent ) . not . toBe ( 'Create ' ) ;
113- expect ( buttons [ 0 ] . textContent ) . not . toBe ( 'Manage ' ) ;
119+ expect ( buttons [ 0 ] . textContent ) . toBe ( ' Filters ' ) ;
120+ expect ( buttons [ 1 ] . textContent ) . toBe ( 'Filters ' ) ;
114121
115122 const menuItems = document . querySelectorAll ( '.lk-menu-item' ) ;
116123 expect ( menuItems ) . toHaveLength ( 6 ) ;
0 commit comments