@@ -2,8 +2,10 @@ import 'package:flutter/material.dart' as material;
22import 'package:flutter_test/flutter_test.dart' ;
33import 'package:querya_desktop/core/layout/ui_scale.dart' ;
44import 'package:querya_desktop/core/ui/querya_control_tokens.dart' ;
5+ import 'package:querya_desktop/shared/widgets/querya_button.dart' ;
56import 'package:querya_desktop/shared/widgets/querya_dropdown.dart' ;
67import 'package:querya_desktop/shared/widgets/querya_icon_button.dart' ;
8+ import 'package:querya_desktop/shared/widgets/querya_menu_button.dart' ;
79import 'package:querya_desktop/shared/widgets/querya_search_field.dart' ;
810import 'package:querya_desktop/shared/widgets/querya_tab_strip.dart' ;
911
@@ -128,5 +130,63 @@ void main() {
128130 );
129131 }
130132 });
133+
134+ testWidgets ('buttons, menus, dropdowns and tabs in one scope share a height' ,
135+ (tester) async {
136+ // A toolbar like the ERD one: nothing sets its own size.
137+ await tester.pumpWidget (
138+ queryaThemeTestShell (
139+ child: material.Center (
140+ child: QueryaControlScope (
141+ size: QueryaControlSize .md,
142+ child: material.Row (
143+ mainAxisSize: material.MainAxisSize .min,
144+ crossAxisAlignment: material.CrossAxisAlignment .start,
145+ children: [
146+ QueryaButton .secondary (
147+ key: const material.ValueKey ('button' ),
148+ label: 'Refresh' ,
149+ onPressed: () {},
150+ ),
151+ QueryaTabStrip (
152+ key: const material.ValueKey ('tabs' ),
153+ labels: const ['Names' , 'Keys' , 'All' ],
154+ selectedIndex: 0 ,
155+ onSelected: (_) {},
156+ ),
157+ QueryaMenuButton <String >(
158+ key: const material.ValueKey ('menu' ),
159+ label: 'Views' ,
160+ items: const [],
161+ onSelected: (_) {},
162+ ),
163+ material.SizedBox (
164+ width: 160 ,
165+ child: QueryaDropdown <String >(
166+ key: const material.ValueKey ('dropdown' ),
167+ value: 'a' ,
168+ items: const [
169+ QueryaDropdownItem (value: 'a' , label: 'Alpha' ),
170+ ],
171+ onSelected: (_) {},
172+ ),
173+ ),
174+ ],
175+ ),
176+ ),
177+ ),
178+ ),
179+ );
180+ await tester.pump ();
181+ await tester.pumpAndSettle ();
182+
183+ for (final k in ['button' , 'tabs' , 'menu' , 'dropdown' ]) {
184+ expect (
185+ tester.getSize (find.byKey (material.ValueKey (k))).height,
186+ QueryaControlSize .md.height,
187+ reason: k,
188+ );
189+ }
190+ });
131191 });
132192}
0 commit comments