From 53b93f092b8f0f68e4a5a48779fc00fc35b000e5 Mon Sep 17 00:00:00 2001 From: Jeroen Schweitzer Date: Sun, 28 Jun 2026 00:57:26 +0200 Subject: [PATCH] test(claude): scope the Claude-category select assertion to the defaults fields The Account section (T-482) adds custom-kind controls to the Claude settings category, so the T-457 test can no longer assert that *every* field in the category is a select. Scope the kind/options check to the new-session-default fields (model/effort/permission) it was actually about. Co-Authored-By: Claude Opus 4.8 (1M context) --- test/builtin/claude/extension_commands_test.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/builtin/claude/extension_commands_test.dart b/test/builtin/claude/extension_commands_test.dart index caf68ab5..ee0ea328 100644 --- a/test/builtin/claude/extension_commands_test.dart +++ b/test/builtin/claude/extension_commands_test.dart @@ -164,9 +164,13 @@ void main() { test('contributes new-session default fields for model, effort, permission', () { expect(category.title, 'Claude'); - final keys = category.sections.expand((s) => s.fields).map((f) => f.key).toSet(); + final fields = category.sections.expand((s) => s.fields).toList(); + final keys = fields.map((f) => f.key).toSet(); expect(keys, containsAll([kDefaultModelKey, kDefaultEffortKey, kDefaultPermissionModeKey])); - for (final f in category.sections.expand((s) => s.fields)) { + // The new-session-default fields are selects with options; other sections + // (e.g. the Account custom controls, T-482) have their own field kinds. + final defaults = fields.where((f) => {kDefaultModelKey, kDefaultEffortKey, kDefaultPermissionModeKey}.contains(f.key)); + for (final f in defaults) { expect(f.kind, SettingsFieldKind.select); expect(f.options, isNotEmpty); }