Files
pipelines/app/test/features/chat/conversation/chat_composer_placeholder_test.dart
T
alan 8f52c7ec55 Narrow chat tests to Material hosts
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.
2026-11-11 12:35:38 +00:00

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,
);
});
}