From 73f9e85598b8ac8338f501cb7851aa0955eafd77 Mon Sep 17 00:00:00 2001 From: Ngo Quoc Dat Date: Thu, 24 Sep 2026 02:43:38 +0700 Subject: [PATCH] test: move the materialized view Quick Switcher tests onto the frecency key API --- .../Main/MaterializedViewRowWriteTests.swift | 3 ++- .../Views/QuickSwitcherObjectKindTests.swift | 15 ++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/TableProTests/Views/Main/MaterializedViewRowWriteTests.swift b/TableProTests/Views/Main/MaterializedViewRowWriteTests.swift index e5fdbb5634..e9cd7a5bd9 100644 --- a/TableProTests/Views/Main/MaterializedViewRowWriteTests.swift +++ b/TableProTests/Views/Main/MaterializedViewRowWriteTests.swift @@ -130,7 +130,8 @@ struct MaterializedViewRowWriteTests { let item = try #require( QuickSwitcherViewModel.makeCrossConnectionItems( tables: [TableInfo(name: "daily_totals", type: .materializedView, rowCount: nil)], - target: target + target: target, + connectionSwitchesDatabases: true ).first ) fromSwitcher.handleQuickSwitcherSelection(item) diff --git a/TableProTests/Views/QuickSwitcherObjectKindTests.swift b/TableProTests/Views/QuickSwitcherObjectKindTests.swift index 1e23fc7d31..e47c0888ac 100644 --- a/TableProTests/Views/QuickSwitcherObjectKindTests.swift +++ b/TableProTests/Views/QuickSwitcherObjectKindTests.swift @@ -25,7 +25,8 @@ struct QuickSwitcherObjectKindTests { TableInfo(name: "daily_totals", type: .materializedView, rowCount: nil), TableInfo(name: "orders", type: .partitionedTable, rowCount: nil) ], - target: target + target: target, + connectionSwitchesDatabases: true ) #expect(items.map(\.tableType) == [.materializedView, .partitionedTable]) @@ -46,7 +47,11 @@ struct QuickSwitcherObjectKindTests { defer { coordinator.teardown() } let item = QuickSwitcherItem( - id: QuickSwitcherItem.tableItemId(name: "daily_totals", schema: "public"), + frecencyKey: QuickSwitcherFrecencyKey.table( + name: "daily_totals", + schema: "public", + in: .init(database: "shop", connectionSwitchesDatabases: true) + ), name: "daily_totals", kind: .view, subtitle: String(localized: "Materialized View"), @@ -75,7 +80,11 @@ struct QuickSwitcherObjectKindTests { defer { coordinator.teardown() } let item = QuickSwitcherItem( - id: QuickSwitcherItem.tableItemId(name: "events", schema: "public"), + frecencyKey: QuickSwitcherFrecencyKey.table( + name: "events", + schema: "public", + in: .init(database: "shop", connectionSwitchesDatabases: true) + ), name: "events", kind: .table, subtitle: String(localized: "Partitioned Table"),