test: ロジックを切り出し、画面操作まで含めたテストを追加する - #32
Merged
Merged
Conversation
- 除外判定と「最近使ったアプリ」一覧の更新を ActiveAppTracker.update に移し、KeyEvent はその結果をグローバル変数へ書くだけにする - 一覧の上限 10 件を定数 recentAppsLimit にする - ActiveAppTrackerTests を追加(12 件) Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- set(_:forKey:) を記録するだけの UserDefaults のサブクラスを使い、"mappings" キーに serialized の結果が書かれることを確かめる Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- 除外アプリ一覧の復元と、キー設定の復元・v2.0.x からの移行・初期設定の選択を StartupSettings に移す - AppDelegate は読み込み結果の出どころに応じて oneShotModifiers の削除と保存を行うだけにする - StartupSettingsTests を追加(17 本) Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- 設定表の参照と OS へのキー送信を KeyEvent のプロパティにし、テストでは記録するだけの関数に差し替えられるようにする - タップのコールバック本体を handle(type:event:) に分ける - KeyEventTests を追加(20 本)。キーの変換、修飾キー単体押し、除外アプリ、メディアキー、タップ無効化の通知を検証する Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- 除外一覧と「最近使ったアプリ」一覧の行の解決、チェック切り替えによる項目の移動、保存形式への変換を ExclusionListEditor に移す - ID から名前を引く辞書の作成は StartupSettings.exclusionAppsDict を使う - ExclusionListEditorTests を追加(14 本) Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- 「ログイン後にこのアプリを起動」の保存値の解釈と、旧設定「起動時にアップデートを確認」の引き継ぎ値を StartupSettings に移す - StartupSettingsTests に 7 本追加 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- KeyMappingListEditorTests の中にあった RecordingDefaults を独立したファイルに移す - 最後に書かれた値を引く lastValue(forKey:) を追加 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- 設定の保存先をグローバルの settingsDefaults に集め、テストでは記録するだけの UserDefaults に差し替える - 設定ウィンドウの各画面を取り出すテスト用ヘルパー PreferenceScreens を追加 - 行の追加・削除・並べ替え・有効切り替え、セルの生成、行数のテストを追加(10 本) Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- 文字列の解決、表示と一覧への反映、保存を commitEditedText に分け、textDidEndEditing はそれを呼ぶ - 既知の文字列の反映、未知の文字列の扱い 2 種、フォーカスの解除のテストを追加(4 本) Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- 行数、各列の表示、チェック切り替えによる一覧の移動と保存、他の列への書き込みの無視のテストを追加(6 本) Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- ViewController の保存先を差し替え可能にし、テストでは記録するだけの UserDefaults を使う - アイコン表示の切り替えと保存、チェックボックスの初期状態、メニューの項目と動作の対応のテストを追加(4 本) Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- 直列実行の親スイート GlobalStateTests を作り、キーリマップ一覧・除外アプリ・設定画面のスイートをその下に入れる - スイート内だけの直列指定では、別スイート同士が同じ保存先や一覧を同時に書き換えて戻し損なう余地があった Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- storyboard からもコードからも呼ばれていない AppDelegate.launch(_:) と ViewController.test(_:) を削除 - Xcode の雛形のまま中身が空だった ViewController.representedObject の didSet を削除 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- 通常キーは欄に記録して OS に渡さない、修飾キーは入力欄なら記録し出力欄なら記録しない、単体押しの変換結果を送らない、メディアキーは入力欄なら記録して捨て出力欄ならそのまま通す、の 4 つの振る舞いを固定する - 設定画面で編集中にキーが変換されてしまう退行を検出するため Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- ウィンドウでフォーカスを取ると activeKeyTextField になり、blur で外れることを確かめる - 一覧画面と設定ウィンドウの mouseDown でフォーカスが外れることを確かめる Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- 通知で渡されたアプリが一覧の先頭に入ること、除外アプリなら除外フラグが立ち一覧には入らないことを確かめる Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- Shift・Control・Option・fn・CapsLock のそれぞれについて、相手が持っていて自分が持たない場合に false になることを確かめる - これまでのテストは Command の欠落しか通しておらず、他の修飾キーの判定は実行されていなかった Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- subtype 8 の NX_SYSDEFINED イベントからキー種別と押下が取り出せること、他の subtype と通常のキーイベントは対象外になることを確かめる - これまで MediaKeyEvent の init は、対象外を弾く経路がテストされていなかった Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- 配列を保存値として渡すと、初回起動ではなくオフと解釈されることを確かめる - integer(forKey:) と同じ解釈になる経路のうち、この分岐だけがテストされていなかった Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- ViewController のメニューバー項目の表示切り替えを差し替え可能にし、テストでは記録するだけの関数を使う - AppKit は NSStatusItem の表示状態をアプリの設定に保存するため、テストホストが本物と同じ設定ファイルへ書き込んでいた Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
🤖 Generated with Claude Code