@@ -180,6 +180,14 @@ describe "TabBarView", ->
180
180
pane .activateItem (editor2)
181
181
expect (tabBar .tabForItem (editor2)).toHaveClass ' modified'
182
182
183
+ describe " when addNewTabsAtEnd is set to true in package settings" , ->
184
+ it " adds a tab for the new item at the end of the tab bar" , ->
185
+ atom .config .set (" tabs.addNewTabsAtEnd" , true )
186
+ item3 = new TestView (' Item 3' )
187
+ pane .activateItem (item3)
188
+ expect ($ (tabBar).find (' .tab' ).length ).toBe 4
189
+ expect ($ (tabBar .tabAtIndex (3 )).find (' .title' )).toHaveText ' Item 3'
190
+
183
191
describe " when addNewTabsAtEnd is set to false in package settings" , ->
184
192
it " adds a tab for the new item at the same index as the item in the pane" , ->
185
193
atom .config .set (" tabs.addNewTabsAtEnd" , false )
@@ -189,14 +197,6 @@ describe "TabBarView", ->
189
197
expect ($ (tabBar).find (' .tab' ).length ).toBe 4
190
198
expect ($ (tabBar .tabAtIndex (1 )).find (' .title' )).toHaveText ' Item 3'
191
199
192
- describe " when addNewTabsAtEnd is set to true in package settings" , ->
193
- it " adds a tab for the new item at the end of the tab bar" , ->
194
- atom .config .set (" tabs.showIcons" , true )
195
- item3 = new TestView (' Item 3' )
196
- pane .activateItem (item3)
197
- expect ($ (tabBar).find (' .tab' ).length ).toBe 4
198
- expect ($ (tabBar .tabAtIndex (3 )).find (' .title' )).toHaveText ' Item 3'
199
-
200
200
describe " when an item is removed from the pane" , ->
201
201
it " removes the item's tab from the tab bar" , ->
202
202
pane .destroyItem (item2)
@@ -389,14 +389,28 @@ describe "TabBarView", ->
389
389
expect (tab).not .toHaveClass ' modified'
390
390
391
391
describe " when a pane item moves to a new index" , ->
392
- it " updates the order of the tabs to match the new item order" , ->
393
- expect (tabBar .getTabs ().map (tab) -> tab .textContent ).toEqual [" Item 1" , " sample.js" , " Item 2" ]
394
- pane .moveItem (item2, 1 )
395
- expect (tabBar .getTabs ().map (tab) -> tab .textContent ).toEqual [" Item 1" , " Item 2" , " sample.js" ]
396
- pane .moveItem (editor1, 0 )
397
- expect (tabBar .getTabs ().map (tab) -> tab .textContent ).toEqual [" sample.js" , " Item 1" , " Item 2" ]
398
- pane .moveItem (item1, 2 )
399
- expect (tabBar .getTabs ().map (tab) -> tab .textContent ).toEqual [" sample.js" , " Item 2" , " Item 1" ]
392
+ # behavior is independent of addNewTabs config
393
+ describe " when addNewTabsAtEnd is set to true in package settings" , ->
394
+ it " updates the order of the tabs to match the new item order" , ->
395
+ atom .config .set (" tabs.addNewTabsAtEnd" , true )
396
+ expect (tabBar .getTabs ().map (tab) -> tab .textContent ).toEqual [" Item 1" , " sample.js" , " Item 2" ]
397
+ pane .moveItem (item2, 1 )
398
+ expect (tabBar .getTabs ().map (tab) -> tab .textContent ).toEqual [" Item 1" , " Item 2" , " sample.js" ]
399
+ pane .moveItem (editor1, 0 )
400
+ expect (tabBar .getTabs ().map (tab) -> tab .textContent ).toEqual [" sample.js" , " Item 1" , " Item 2" ]
401
+ pane .moveItem (item1, 2 )
402
+ expect (tabBar .getTabs ().map (tab) -> tab .textContent ).toEqual [" sample.js" , " Item 2" , " Item 1" ]
403
+
404
+ describe " when addNewTabsAtEnd is set to false in package settings" , ->
405
+ it " updates the order of the tabs to match the new item order" , ->
406
+ atom .config .set (" tabs.addNewTabsAtEnd" , false )
407
+ expect (tabBar .getTabs ().map (tab) -> tab .textContent ).toEqual [" Item 1" , " sample.js" , " Item 2" ]
408
+ pane .moveItem (item2, 1 )
409
+ expect (tabBar .getTabs ().map (tab) -> tab .textContent ).toEqual [" Item 1" , " Item 2" , " sample.js" ]
410
+ pane .moveItem (editor1, 0 )
411
+ expect (tabBar .getTabs ().map (tab) -> tab .textContent ).toEqual [" sample.js" , " Item 1" , " Item 2" ]
412
+ pane .moveItem (item1, 2 )
413
+ expect (tabBar .getTabs ().map (tab) -> tab .textContent ).toEqual [" sample.js" , " Item 2" , " Item 1" ]
400
414
401
415
describe " context menu commands" , ->
402
416
beforeEach ->
0 commit comments