Skip to content

Add unit coverage for sidebar layout and session behavior #15

Description

@KSHITIZ6341

Summary

Current tests cover SettingsStore and PinSessionStateMachine, but not the higher-risk sidebar session behavior.

Current behavior

There are only two test files:

  • Tests/SwitcherTests/SettingsStoreTests.swift
  • Tests/SwitcherTests/PinSessionStateMachineTests.swift

High-risk behavior in PinSessionManager is currently untested.

Suggested coverage

Add tests for:

  • width clamping per display
  • stack layout for 1, 2, and 3 pinned apps
  • unpin/reorder behavior
  • moved/resized manual break detection
  • persistence of edge/display/width settings
  • closed-window removal behavior where feasible

Suggested implementation approach

  • Extract pure layout helpers where useful.
  • Introduce injectable display/window doubles for session tests.
  • Keep UI/AppKit integration tests manual for now.

Acceptance criteria

  • Sidebar layout/session logic has focused unit tests.
  • Tests avoid requiring live third-party app windows.
  • CI can run the test suite reliably.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions