@@ -52,46 +52,39 @@ describe('deriveSidebarCapacity', () => {
5252
5353describe ( 'docksSplitGroupsWithCapacity (sidebar overflow)' , ( ) => {
5454 it ( 'folds members beyond capacity into overflow, preserving order' , ( ) => {
55- const groups : DevToolsDockEntriesGrouped = [ [ 'default' , [ iframe ( 'a' ) , iframe ( 'b' ) , iframe ( 'c' ) ] ] ]
55+ const groups : DevToolsDockEntriesGrouped = [ [ 'default' , [ iframe ( 'a' ) , iframe ( 'b' ) , iframe ( 'c' ) , iframe ( 'd' ) ] ] ]
5656 const { visible, overflow } = docksSplitGroupsWithCapacity ( groups , 2 )
5757 expect ( visible ) . toEqual ( [ [ 'default' , [ iframe ( 'a' ) , iframe ( 'b' ) ] ] ] )
58- expect ( overflow ) . toEqual ( [ [ 'default' , [ iframe ( 'c' ) ] ] ] )
58+ expect ( overflow ) . toEqual ( [ [ 'default' , [ iframe ( 'c' ) , iframe ( 'd' ) ] ] ] )
5959 } )
6060
6161 it ( 'splits across sub-categories once the first fills capacity' , ( ) => {
6262 const groups : DevToolsDockEntriesGrouped = [
6363 [ 'app' , [ iframe ( 'a' ) , iframe ( 'b' ) ] ] ,
64- [ 'web' , [ iframe ( 'c' ) , iframe ( 'd' ) ] ] ,
64+ [ 'web' , [ iframe ( 'c' ) , iframe ( 'd' ) , iframe ( 'e' ) ] ] ,
6565 ]
6666 const { visible, overflow } = docksSplitGroupsWithCapacity ( groups , 3 )
6767 expect ( visible ) . toEqual ( [ [ 'app' , [ iframe ( 'a' ) , iframe ( 'b' ) ] ] , [ 'web' , [ iframe ( 'c' ) ] ] ] )
68- expect ( overflow ) . toEqual ( [ [ 'web' , [ iframe ( 'd' ) ] ] ] )
68+ expect ( overflow ) . toEqual ( [ [ 'web' , [ iframe ( 'd' ) , iframe ( 'e' ) ] ] ] )
6969 } )
7070
71- it ( 'leaves a single overflowing entry in overflow by default ' , ( ) => {
71+ it ( 'folds a lone overflowing entry back into visible instead of leaving it in overflow ' , ( ) => {
7272 const groups : DevToolsDockEntriesGrouped = [ [ 'default' , [ iframe ( 'a' ) , iframe ( 'b' ) , iframe ( 'c' ) ] ] ]
7373 const { visible, overflow } = docksSplitGroupsWithCapacity ( groups , 2 )
74- expect ( visible ) . toEqual ( [ [ 'default' , [ iframe ( 'a' ) , iframe ( 'b' ) ] ] ] )
75- expect ( overflow ) . toEqual ( [ [ 'default' , [ iframe ( 'c' ) ] ] ] )
76- } )
77-
78- it ( 'foldSingleOverflow folds a lone overflowing entry back into visible' , ( ) => {
79- const groups : DevToolsDockEntriesGrouped = [ [ 'default' , [ iframe ( 'a' ) , iframe ( 'b' ) , iframe ( 'c' ) ] ] ]
80- const { visible, overflow } = docksSplitGroupsWithCapacity ( groups , 2 , { foldSingleOverflow : true } )
8174 expect ( visible ) . toEqual ( [ [ 'default' , [ iframe ( 'a' ) , iframe ( 'b' ) ] ] , [ 'default' , [ iframe ( 'c' ) ] ] ] )
8275 expect ( overflow ) . toEqual ( [ ] )
8376 } )
8477
85- it ( 'foldSingleOverflow leaves two or more overflowing entries alone ' , ( ) => {
78+ it ( 'leaves two or more overflowing entries as overflow ' , ( ) => {
8679 const groups : DevToolsDockEntriesGrouped = [ [ 'default' , [ iframe ( 'a' ) , iframe ( 'b' ) , iframe ( 'c' ) , iframe ( 'd' ) ] ] ]
87- const { visible, overflow } = docksSplitGroupsWithCapacity ( groups , 2 , { foldSingleOverflow : true } )
80+ const { visible, overflow } = docksSplitGroupsWithCapacity ( groups , 2 )
8881 expect ( visible ) . toEqual ( [ [ 'default' , [ iframe ( 'a' ) , iframe ( 'b' ) ] ] ] )
8982 expect ( overflow ) . toEqual ( [ [ 'default' , [ iframe ( 'c' ) , iframe ( 'd' ) ] ] ] )
9083 } )
9184
92- it ( 'foldSingleOverflow is a no-op when nothing overflows' , ( ) => {
85+ it ( 'is a no-op when nothing overflows' , ( ) => {
9386 const groups : DevToolsDockEntriesGrouped = [ [ 'default' , [ iframe ( 'a' ) , iframe ( 'b' ) ] ] ]
94- const { visible, overflow } = docksSplitGroupsWithCapacity ( groups , 2 , { foldSingleOverflow : true } )
87+ const { visible, overflow } = docksSplitGroupsWithCapacity ( groups , 2 )
9588 expect ( visible ) . toEqual ( groups )
9689 expect ( overflow ) . toEqual ( [ ] )
9790 } )
0 commit comments