Skip to content

Commit 73f9e85

Browse files
committed
test: move the materialized view Quick Switcher tests onto the frecency key API
1 parent 88777bc commit 73f9e85

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

‎TableProTests/Views/Main/MaterializedViewRowWriteTests.swift‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ struct MaterializedViewRowWriteTests {
130130
let item = try #require(
131131
QuickSwitcherViewModel.makeCrossConnectionItems(
132132
tables: [TableInfo(name: "daily_totals", type: .materializedView, rowCount: nil)],
133-
target: target
133+
target: target,
134+
connectionSwitchesDatabases: true
134135
).first
135136
)
136137
fromSwitcher.handleQuickSwitcherSelection(item)

‎TableProTests/Views/QuickSwitcherObjectKindTests.swift‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ struct QuickSwitcherObjectKindTests {
2525
TableInfo(name: "daily_totals", type: .materializedView, rowCount: nil),
2626
TableInfo(name: "orders", type: .partitionedTable, rowCount: nil)
2727
],
28-
target: target
28+
target: target,
29+
connectionSwitchesDatabases: true
2930
)
3031

3132
#expect(items.map(\.tableType) == [.materializedView, .partitionedTable])
@@ -46,7 +47,11 @@ struct QuickSwitcherObjectKindTests {
4647
defer { coordinator.teardown() }
4748

4849
let item = QuickSwitcherItem(
49-
id: QuickSwitcherItem.tableItemId(name: "daily_totals", schema: "public"),
50+
frecencyKey: QuickSwitcherFrecencyKey.table(
51+
name: "daily_totals",
52+
schema: "public",
53+
in: .init(database: "shop", connectionSwitchesDatabases: true)
54+
),
5055
name: "daily_totals",
5156
kind: .view,
5257
subtitle: String(localized: "Materialized View"),
@@ -75,7 +80,11 @@ struct QuickSwitcherObjectKindTests {
7580
defer { coordinator.teardown() }
7681

7782
let item = QuickSwitcherItem(
78-
id: QuickSwitcherItem.tableItemId(name: "events", schema: "public"),
83+
frecencyKey: QuickSwitcherFrecencyKey.table(
84+
name: "events",
85+
schema: "public",
86+
in: .init(database: "shop", connectionSwitchesDatabases: true)
87+
),
7988
name: "events",
8089
kind: .table,
8190
subtitle: String(localized: "Partitioned Table"),

0 commit comments

Comments
 (0)