File tree Expand file tree Collapse file tree
src/tests/components/Settings Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -403,6 +403,8 @@ describe('Settings', () => {
403403 wrapper = createWrapper ( false , true , {
404404 signature_flow : {
405405 editableByCurrentActor : true ,
406+ groupCount : 1 ,
407+ userCount : 0 ,
406408 } ,
407409 } )
408410 const items = getItems ( )
@@ -411,6 +413,19 @@ describe('Settings', () => {
411413 expect ( policiesItem . props ( 'to' ) ) . toEqual ( { name : 'Policies' } )
412414 } )
413415
416+ it ( 'hides Policies for non-admin users when only system-level editable policies exist' , ( ) => {
417+ wrapper = createWrapper ( false , true , {
418+ docmdp : {
419+ editableByCurrentActor : true ,
420+ groupCount : 0 ,
421+ userCount : 0 ,
422+ } ,
423+ } )
424+ const items = getItems ( )
425+
426+ expect ( findItemByName ( items , 'Policies' ) ) . toBeUndefined ( )
427+ } )
428+
414429 it ( 'renders the policies icon for admin users' , ( ) => {
415430 wrapper = createWrapper ( true )
416431
@@ -601,6 +616,8 @@ describe('Settings', () => {
601616 wrapper = createWrapper ( false , true , {
602617 signature_flow : {
603618 editableByCurrentActor : true ,
619+ groupCount : 1 ,
620+ userCount : 0 ,
604621 } ,
605622 } )
606623 const items = getItems ( )
You can’t perform that action at this time.
0 commit comments