From 389396a39b2d0a6162ab38ec2a480a1a8d35aba6 Mon Sep 17 00:00:00 2001 From: Aforno Date: Fri, 28 Aug 2026 19:11:39 +0100 Subject: [PATCH] test: trim overlapping agent-row and accent contrast cases - fold privacy-mode assertions into the task/project split test - drop duplicate project-chip, glyph-hue, and luminance coverage --- .../AgentRowPresentationTests.swift | 40 +------------------ .../NotchAccentContrastTests.swift | 28 ------------- 2 files changed, 1 insertion(+), 67 deletions(-) diff --git a/Tests/AgentsNotchTests/AgentRowPresentationTests.swift b/Tests/AgentsNotchTests/AgentRowPresentationTests.swift index 2a32087..f838962 100644 --- a/Tests/AgentsNotchTests/AgentRowPresentationTests.swift +++ b/Tests/AgentsNotchTests/AgentRowPresentationTests.swift @@ -148,7 +148,7 @@ final class AgentRowPresentationTests: XCTestCase { XCTAssertEqual(AgentRowPresentation.formattedRole(" "), "Subagent") } - func testRowSplitsTaskFromProjectSoTheProjectSurvivesTruncation() { + func testRowSeparatesTaskFromProjectAndHidesBothInPrivacyMode() { let session = session( id: "root", state: .running, @@ -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" @@ -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) diff --git a/Tests/AgentsNotchTests/NotchAccentContrastTests.swift b/Tests/AgentsNotchTests/NotchAccentContrastTests.swift index 590bcf6..91640b8 100644 --- a/Tests/AgentsNotchTests/NotchAccentContrastTests.swift +++ b/Tests/AgentsNotchTests/NotchAccentContrastTests.swift @@ -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 - ) - } }