summaryrefslogtreecommitdiff
path: root/SoraTests
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-02-18 12:29:25 -0800
committerFuwn <[email protected]>2026-02-18 12:29:29 -0800
commit0917354dc0b79d1ac414392ae036f784eb397113 (patch)
treeede2a5b3935eed05607f6a493d8a34ce74d9834d /SoraTests
parentperf: eliminate repeated favorites sort map and grid recompute (diff)
downloadsora-testing-0917354dc0b79d1ac414392ae036f784eb397113.tar.xz
sora-testing-0917354dc0b79d1ac414392ae036f784eb397113.zip
refactor: share folder menu hierarchy across views
Diffstat (limited to 'SoraTests')
-rw-r--r--SoraTests/ViewDerivedDataTests.swift25
1 files changed, 25 insertions, 0 deletions
diff --git a/SoraTests/ViewDerivedDataTests.swift b/SoraTests/ViewDerivedDataTests.swift
index da5ad0d..eb426f7 100644
--- a/SoraTests/ViewDerivedDataTests.swift
+++ b/SoraTests/ViewDerivedDataTests.swift
@@ -102,6 +102,31 @@ final class ViewDerivedDataTests: XCTestCase {
)
}
+ func testFolderMenuHierarchyIsSharedAcrossConsumers() throws {
+ let consumerPaths = [
+ "Sora/Views/Generic/GenericListView.swift",
+ "Sora/Views/FavoritesView.swift",
+ "Sora/Views/Post/Grid/PostGridView.swift",
+ "Sora/Views/BookmarkMenuButtonView.swift",
+ "Sora/Views/FavoriteMenuButtonView.swift",
+ ]
+
+ for consumerPath in consumerPaths {
+ let source = try loadSource(at: consumerPath)
+ let sharedMenuUsages = tokenCount(
+ matching: #"\bFolderMenuView\s*\("#,
+ in: source
+ )
+
+ // swiftlint:disable:next prefer_nimble
+ XCTAssertGreaterThan(
+ sharedMenuUsages,
+ 0,
+ "\(consumerPath) should use FolderMenuView for folder hierarchy rendering."
+ )
+ }
+ }
+
private func referenceCount(for symbol: String, in source: String) -> Int {
let totalMatches = tokenCount(
matching: #"\b\#(symbol)\b"#,