Adopt root-level tsswift app layout
CI / test (push) Has been cancelled

Move the app payload under swift/ while keeping git, package.json, and .smartconfig.json at the repo root. This standardizes the Swift app setup so build, test, run, and watch workflows match the other repos.
This commit is contained in:
2026-04-19 01:21:43 +02:00
parent d534964601
commit a6939453f8
61 changed files with 2341 additions and 3 deletions
@@ -0,0 +1,28 @@
import XCTest
@testable import IDPGlobal
final class PairingPayloadParserTests: XCTestCase {
func testParsesStructuredPairingPayload() throws {
let payload = "idp.global://pair?token=swiftapp-demo-berlin&origin=code.foss.global&device=Safari%20on%20Berlin%20MBP"
let context = try PairingPayloadParser.parse(payload)
XCTAssertEqual(context.deviceName, "Safari on Berlin MBP")
XCTAssertEqual(context.originHost, "code.foss.global")
XCTAssertEqual(context.tokenPreview, "berlin")
}
func testParsesManualFallbackPayload() throws {
let context = try PairingPayloadParser.parse("manual pair token 1234567890")
XCTAssertEqual(context.deviceName, "Manual Session")
XCTAssertEqual(context.originHost, "code.foss.global")
XCTAssertEqual(context.tokenPreview, "567890")
}
func testRejectsInvalidPayload() {
XCTAssertThrowsError(try PairingPayloadParser.parse("https://example.com")) { error in
XCTAssertEqual(error as? AppError, .invalidPairingPayload)
}
}
}