Skip to content

Add UI, session and workstore tests#134

Merged
jbcrane13 merged 1 commit into
mainfrom
codex/fix-open-agentboard-tickets
May 25, 2026
Merged

Add UI, session and workstore tests#134
jbcrane13 merged 1 commit into
mainfrom
codex/fix-open-agentboard-tickets

Conversation

@jbcrane13

Copy link
Copy Markdown
Owner

Add several unit tests and a small docs update to improve coverage and validate behavior:

  • Update AGENTS.md with an Activity entry for 2026-05-24.
  • Add NativeSwiftUIInterfaceTests asserting SceneStorage, CreateIssueSheet init/state, session launch handling, and session detail terminal UI.
  • Add SessionLauncherTests covering checkSession outcomes (completed/failed) and include a FakeTmuxController actor to simulate tmux behavior.
  • Add WorkStoreCRUDTests test for createIssue returning the created item on success.

These changes increase confidence around UI wiring, tmux session checks, and issue creation flows.

Add several unit tests and a small docs update to improve coverage and validate behavior:

- Update AGENTS.md with an Activity entry for 2026-05-24.
- Add NativeSwiftUIInterfaceTests asserting SceneStorage, CreateIssueSheet init/state, session launch handling, and session detail terminal UI.
- Add SessionLauncherTests covering checkSession outcomes (completed/failed) and include a FakeTmuxController actor to simulate tmux behavior.
- Add WorkStoreCRUDTests test for createIssue returning the created item on success.

These changes increase confidence around UI wiring, tmux session checks, and issue creation flows.
Copilot AI review requested due to automatic review settings May 25, 2026 06:09
@jbcrane13 jbcrane13 merged commit 4213f96 into main May 25, 2026
1 of 2 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to improve confidence/coverage by adding unit tests around UI “contract” behaviors, tmux session status handling, and WorkStore issue creation, plus a small AGENTS.md activity log update.

Changes:

  • Add an Activity entry for 2026-05-24 in AGENTS.md.
  • Add new tests for WorkStore issue creation return behavior and SessionLauncher session checking.
  • Add/extend source-based SwiftUI interface contract tests for repository persistence, create-issue sheet seeding, and terminal UI expectations.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
AGENTS.md Adds an Activity entry for 2026-05-24.
AgentBoardTests/WorkStoreCRUDTests.swift Adds a test asserting createIssue returns the created item.
AgentBoardTests/SessionLauncherTests.swift Adds tests for checkSession interpreting session completion/failure.
AgentBoardTests/NativeSwiftUIInterfaceTests.swift Adds UI contract tests by asserting expected source snippets are present.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +89 to +94
let created = await store.createIssue(
repository: ConfiguredRepository(owner: "org", name: "repo"),
title: "Dismiss sheet",
body: "Body here"
)

Comment on lines +130 to +152
@Test @MainActor func checkSessionReturnsCompletedWhenPaneShowsSuccessfulExit() async {
let launcher = SessionLauncher(tmux: FakeTmuxController(
hasSessionResult: true,
paneOutput: "work complete\nEXITED: 0"
))
let session = makeActiveSession(name: "ab-agentboard-130")

let status = await launcher.checkSession(session)

#expect(status == .completed)
}

@Test @MainActor func checkSessionReturnsFailedWhenPaneShowsNonzeroExit() async {
let launcher = SessionLauncher(tmux: FakeTmuxController(
hasSessionResult: true,
paneOutput: "Failed to authenticate\nEXITED: 1"
))
let session = makeActiveSession(name: "ab-agentboard-132")

let status = await launcher.checkSession(session)

#expect(status == .failed)
}
Comment on lines +81 to +89
@Test func workBoardPersistsSelectedRepositoryAndSeedsCreateIssueSheet() throws {
let workSource = try Self.source("AgentBoardUI/Screens/WorkScreen.swift")
let createSource = try Self.source("AgentBoardUI/Screens/CreateIssueSheet.swift")

#expect(workSource.contains(#"@SceneStorage("work.selectedRepository")"#))
#expect(workSource.contains("CreateIssueSheet(initialRepository: selectedCreateRepository)"))
#expect(workSource.contains("private var selectedCreateRepository: ConfiguredRepository?"))
#expect(createSource.contains("init(initialRepository: ConfiguredRepository? = nil)"))
#expect(createSource.contains("_selectedRepository = State(initialValue: initialRepository)"))
Comment on lines +92 to +96
@Test func launchedSessionsOpenTerminalInDesktopShell() throws {
let source = try Self.source("AgentBoard/DesktopRootView.swift")

#expect(source.contains("onChange(of: appModel.sessionLauncher.activeSessions.map(\\.id))"))
#expect(source.contains("activeSessionTerminal = session"))
Comment on lines +99 to +105
@Test func companionSessionDetailOffersTerminalWhenTmuxSessionExists() throws {
let source = try Self.source("AgentBoardUI/Screens/SessionDetailSheet.swift")

#expect(source.contains("session.tmuxSession"))
#expect(source.contains(#"Text("Terminal").tag(2)"#))
#expect(source.contains("SessionLauncher.attachCommand(for: tmuxSession)"))
#expect(source.contains("EmbeddedTerminalView("))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants