8f52c7ec55
Remove Cupertino-only fixtures, test variants, and the obsolete readable-text test now that the app is Material-only. Preserve the Material coverage while avoiding unreachable platform branches.
49 lines
1.5 KiB
Dart
49 lines
1.5 KiB
Dart
import 'package:flutter/rendering.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:pipelines_app/features/chat/conversation/chat_composer_bar.dart';
|
|
|
|
import 'chat_composer_bar_fixtures.dart';
|
|
|
|
void main() {
|
|
test('the placeholder names the chat\'s folder when it has one', () {
|
|
expect(chatComposerPlaceholderFor('/Users/ada/repos/tank'), 'Work on tank');
|
|
expect(
|
|
chatComposerPlaceholderFor('/Users/ada/repos/tank/'),
|
|
'Work on tank',
|
|
);
|
|
expect(chatComposerPlaceholderFor(r'C:\\work\\tank'), 'Work on tank');
|
|
expect(chatComposerPlaceholderFor(' '), chatComposerPlaceholder);
|
|
expect(chatComposerPlaceholderFor('/'), chatComposerPlaceholder);
|
|
});
|
|
|
|
testWidgets('the composer is one pill holding attach, field and Send', (
|
|
tester,
|
|
) async {
|
|
final gateway = ComposerBarGateway();
|
|
addTearDown(gateway.close);
|
|
await tester.pumpWidget(
|
|
composerThread(
|
|
gateway,
|
|
session: const {'id': 's', 'directory': '/Users/ada/repos/tank'},
|
|
),
|
|
);
|
|
await tester.pumpAndSettle();
|
|
|
|
final pill = find.byKey(const Key('chat-composer-pill'));
|
|
for (final key in [
|
|
'chat-composer-attach',
|
|
'chat-composer-field',
|
|
'chat-composer-primary',
|
|
]) {
|
|
expect(
|
|
find.descendant(of: pill, matching: find.byKey(Key(key))),
|
|
findsOneWidget,
|
|
);
|
|
}
|
|
expect(
|
|
find.descendant(of: pill, matching: find.text('Work on tank')),
|
|
findsOneWidget,
|
|
);
|
|
});
|
|
}
|