Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public enum PresentationState: String, Equatable, Sendable {
case error
}

public struct PresentationSnapshot: Equatable, Sendable {
public struct PresentationSnapshot: Equatable, @unchecked Sendable {
public let state: PresentationState
public let errorMessage: String?
public let output: Any?
Expand All @@ -31,7 +31,7 @@ public enum CapabilityPhase: String, Equatable, Sendable {
case result
}

public struct CapabilityProgressStep: Equatable, Sendable {
public struct CapabilityProgressStep: Equatable, @unchecked Sendable {
public let capabilityId: String
public let phase: CapabilityPhase
public let sequence: UInt64
Expand Down Expand Up @@ -61,7 +61,7 @@ public struct CapabilityProgressStep: Equatable, Sendable {
}

/// Minimal embedder event fields required by the mapper.
public struct EmbedderEventLike: Equatable, Sendable {
public struct EmbedderEventLike: Equatable, @unchecked Sendable {
public let eventType: String
public let sequence: UInt64
public let data: [String: Any]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,18 @@ final class AppStateViewModelTests: XCTestCase {
XCTAssertNotNil(vm.sessionId)
}

func testResetReturnsToIdle() throws {
func testResetReturnsToIdle() async throws {
let host = try EmbeddedHost.createTestHost(output: sampleOutput)
let vm = AppStateViewModel(host: host, workspaceId: "local-default")
vm.errorMessage = "boom"
vm.document = "document text"
vm.submit()
try await Task.sleep(nanoseconds: 200_000_000)
XCTAssertEqual(vm.currentState, "completed")
vm.reset()
XCTAssertEqual(vm.currentState, "idle")
XCTAssertNil(vm.errorMessage)
XCTAssertNil(vm.output)
XCTAssertEqual(vm.presentationState, .idle)
}
}

Expand Down
Loading