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) <noreply@anthropic.com>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user