Skip to content
Merged
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
40 changes: 1 addition & 39 deletions Tests/AgentsNotchTests/AgentRowPresentationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ final class AgentRowPresentationTests: XCTestCase {
XCTAssertEqual(AgentRowPresentation.formattedRole(" "), "Subagent")
}

func testRowSplitsTaskFromProjectSoTheProjectSurvivesTruncation() {
func testRowSeparatesTaskFromProjectAndHidesBothInPrivacyMode() {
let session = session(
id: "root",
state: .running,
Expand All @@ -164,35 +164,6 @@ final class AgentRowPresentationTests: XCTestCase {
AgentRowPresentation.projectChip(for: session, privacyModeEnabled: false),
"AgentNotch"
)
}

func testProjectChipIsOmittedWhenItWouldRepeatTheTitle() {
let noTask = session(id: "a", state: .running, workingDirectory: "/Users/me/AgentNotch")
let taskOnly = session(id: "b", state: .running, task: "Fix authentication")
let subagent = session(
id: "c",
parentID: "a",
state: .running,
task: "Review auth module",
workingDirectory: "/Users/me/AgentNotch",
agentRole: "auditor"
)

XCTAssertEqual(AgentRowPresentation.taskTitle(for: noTask, privacyModeEnabled: false), "AgentNotch")
XCTAssertNil(AgentRowPresentation.projectChip(for: noTask, privacyModeEnabled: false))
XCTAssertNil(AgentRowPresentation.projectChip(for: taskOnly, privacyModeEnabled: false))
// Subagents inherit the parent's project, so repeating it is noise.
XCTAssertNil(AgentRowPresentation.projectChip(for: subagent, privacyModeEnabled: false))
}

func testPrivacyModeHidesTheTaskAndTheProjectChip() {
let session = session(
id: "root",
state: .running,
task: "Fix authentication",
workingDirectory: "/Users/me/AgentNotch"
)

XCTAssertEqual(
AgentRowPresentation.taskTitle(for: session, privacyModeEnabled: true),
"AgentNotch"
Expand All @@ -208,15 +179,6 @@ final class AgentRowPresentationTests: XCTestCase {
XCTAssertFalse(agentStatePresentation(for: .unknown).systemImage.isEmpty)
}

func testActiveStatesShareOneHueAndAreSeparatedByGlyph() {
let active: [AgentState] = [.starting, .running, .executingTool, .thinking, .editing]
XCTAssertEqual(Set(active.map { agentStateColor(for: $0).description }).count, 1)

// Non-spinner active states still need distinct glyphs.
let glyphs = [AgentState.thinking, .editing].map { agentStatePresentation(for: $0).systemImage }
XCTAssertEqual(Set(glyphs).count, glyphs.count)
}

func testListHeightDoesNotReserveChromeRowWhenSessionsAreVisible() {
let first = session(id: "one", state: .running)
let second = session(id: "two", state: .running)
Expand Down
28 changes: 0 additions & 28 deletions Tests/AgentsNotchTests/NotchAccentContrastTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,32 +45,4 @@ final class NotchAccentContrastTests: XCTestCase {
)
}

func testDisabledPrimaryActionUsesReadablePaletteText() {
let yellow = NSColor(srgbRed: 1, green: 0.8, blue: 0, alpha: 1)

XCTAssertEqual(
NotchActionEmphasis.primary.foreground(
isEnabled: false,
isPressed: false,
isHovering: false,
accent: yellow
),
NotchWindowPalette.tertiaryText
)
}

func testBlendedLuminanceIsSourceTimesFillOpacityOverBlack() {
let white = NSColor(srgbRed: 1, green: 1, blue: 1, alpha: 1)
let expected = NotchAccentContrast.relativeLuminance(red: 0.9, green: 0.9, blue: 0.9)
XCTAssertEqual(
NotchAccentContrast.blendedRelativeLuminance(of: white),
expected,
accuracy: 0.0001
)
XCTAssertEqual(
NotchAccentContrast.blendedRelativeLuminance(of: .black),
0,
accuracy: 0.0001
)
}
}
Loading