File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -256,21 +256,18 @@ struct MainContentCoordinatorSortTests {
256256 #expect( tabManager. tabs [ idx] . sortState. columns. isEmpty)
257257 }
258258
259- @Test ( " clearSort on an unsorted tab is a no-op " )
259+ @Test ( " clearSort on an unsorted tab does not crash and leaves sort state empty " )
260260 func clearSortIsNoOpWhenUnsorted( ) {
261- let ( coordinator, _ , tabId) = makeCoordinator ( )
261+ let ( coordinator, tabManager , tabId) = makeCoordinator ( )
262262 seedRows ( coordinator, for: tabId)
263263
264- coordinator. querySortCache [ tabId] = QuerySortCacheEntry (
265- sortedIDs: [ . existing( 0 ) ] ,
266- columnIndex: 0 ,
267- direction: . ascending,
268- schemaVersion: 0
269- )
270-
271264 coordinator. clearSort ( )
272265
273- #expect( coordinator. querySortCache [ tabId] != nil )
266+ guard let idx = tabManager. tabs. firstIndex ( where: { $0. id == tabId } ) else {
267+ Issue . record ( " Expected tab to exist " )
268+ return
269+ }
270+ #expect( tabManager. tabs [ idx] . sortState. columns. isEmpty)
274271 }
275272
276273 @Test ( " cleanupSortCache drops entries for tabs that are no longer open " )
You can’t perform that action at this time.
0 commit comments