Yep. AI rewrote the whole thing.

This commit is contained in:
2026-03-13 03:24:24 +11:00
parent e4719cb9f4
commit fe6c7d8c12
47 changed files with 5348 additions and 1182 deletions

View File

@@ -0,0 +1,32 @@
import XCTest
@testable import CommandNotch
final class WindowFrameCalculatorTests: XCTestCase {
func testClosedStateCentersWindowOnScreen() {
let frame = WindowFrameCalculator.targetFrame(
screenFrame: CGRect(x: 100, y: 50, width: 1600, height: 900),
currentWindowFrame: CGRect(x: 300, y: 0, width: 0, height: 0),
notchState: .closed,
contentSize: CGSize(width: 800, height: 300),
centerHorizontally: false
)
XCTAssertEqual(frame.origin.x, 480, accuracy: 0.001)
XCTAssertEqual(frame.origin.y, 630, accuracy: 0.001)
XCTAssertEqual(frame.size.width, 840, accuracy: 0.001)
XCTAssertEqual(frame.size.height, 320, accuracy: 0.001)
}
func testOpenStateClampsDraggedFrameWithinScreenBounds() {
let frame = WindowFrameCalculator.targetFrame(
screenFrame: CGRect(x: 0, y: 0, width: 1440, height: 900),
currentWindowFrame: CGRect(x: 1200, y: 0, width: 0, height: 0),
notchState: .open,
contentSize: CGSize(width: 900, height: 320),
centerHorizontally: false
)
XCTAssertEqual(frame.origin.x, 500, accuracy: 0.001)
XCTAssertEqual(frame.origin.y, 560, accuracy: 0.001)
}
}