fix(app): a short server URL keeps a one-line settings field
This commit is contained in:
@@ -63,6 +63,7 @@ class SettingsTextField extends StatelessWidget {
|
||||
controller: controller,
|
||||
onChanged: onChanged,
|
||||
keyboardType: TextInputType.url,
|
||||
minLines: 1,
|
||||
maxLines: maxLines,
|
||||
autocorrect: false,
|
||||
enableSuggestions: false,
|
||||
@@ -107,6 +108,7 @@ class SettingsTextField extends StatelessWidget {
|
||||
onChanged: onChanged,
|
||||
placeholder: placeholder,
|
||||
keyboardType: TextInputType.url,
|
||||
minLines: 1,
|
||||
maxLines: maxLines,
|
||||
autocorrect: false,
|
||||
enableSuggestions: false,
|
||||
|
||||
@@ -71,6 +71,28 @@ void main() {
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
|
||||
testWidgets('a short server URL keeps a one-line field', (tester) async {
|
||||
final client = transport.PipelinesClient(
|
||||
channelFactory: FakeChannelFactory().call,
|
||||
);
|
||||
addTearDown(client.dispose);
|
||||
await _pump(
|
||||
tester,
|
||||
client,
|
||||
store: MemorySettingsStore(serverUrl: 'ws://127.0.0.1:8080/connect'),
|
||||
);
|
||||
|
||||
final fields = find.byType(TextField);
|
||||
final url = tester.widget<TextField>(fields.first);
|
||||
expect(url.minLines, 1);
|
||||
// The URL field grows only when its text wraps: one line is the same
|
||||
// height as the single-line workspace field below it.
|
||||
Size editable(Finder field) => tester.getSize(
|
||||
find.descendant(of: field, matching: find.byType(EditableText)),
|
||||
);
|
||||
expect(editable(fields.first).height, editable(fields.last).height);
|
||||
});
|
||||
|
||||
testWidgets('an invalid URL shows the field error and opens no socket', (
|
||||
tester,
|
||||
) async {
|
||||
|
||||
Reference in New Issue
Block a user