Files
ggbond268--mactools/Plugins/HideNotch/Tests/HideNotchDisplayCatalogTests.swift
wehub-resource-sync 1d1286fadb
Build / Build and test (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:18:38 +08:00

72 lines
1.9 KiB
Swift

import XCTest
@testable import MacTools
@testable import HideNotchPlugin
final class HideNotchDisplayCatalogTests: XCTestCase {
func testResolverUsesCurrentPlaceholderWhenCurrentDesktopUUIDIsEmpty() {
let spaces = HideNotchManagedDisplaySpaceResolver.spaces(from: [
"Current Space": [
"uuid": "",
"type": 0
],
"Spaces": [
[
"uuid": "",
"type": 0
]
]
])
XCTAssertEqual(
spaces,
[
HideNotchDisplaySpace(
identifier: HideNotchDisplaySpace.currentPlaceholderIdentifier,
isCurrent: true
)
]
)
}
func testResolverFiltersOutNonDesktopSpaces() {
let spaces = HideNotchManagedDisplaySpaceResolver.spaces(from: [
"Current Space": [
"uuid": "",
"type": 0
],
"Spaces": [
[
"uuid": "",
"type": 0
],
[
"uuid": "E511762E-A085-4DFB-AF2E-B8F5E83A7952",
"type": 4,
"WallSpace": [
"uuid": "48CC1451-CDC2-4890-91F0-A03908F06252",
"type": 6
]
],
[
"uuid": "DESKTOP-2",
"type": 0
]
]
])
XCTAssertEqual(
spaces,
[
HideNotchDisplaySpace(
identifier: HideNotchDisplaySpace.currentPlaceholderIdentifier,
isCurrent: true
),
HideNotchDisplaySpace(
identifier: "DESKTOP-2",
isCurrent: false
)
]
)
}
}