From 9b048f31052d3206cf1415cea21ed2e5ab5539d7 Mon Sep 17 00:00:00 2001 From: Bretton <36870434+BrettM86@users.noreply.github.com> Date: Thu, 16 Jul 2026 04:25:21 -0700 Subject: [PATCH] test(compose): assert thumbnail field stays removed instead of expecting it The two create_post_screen_test thumbnail cases asserted a 'Thumbnail URL' field that was intentionally removed from the UI in 746df36 (thumb dropped from ExternalEmbedInput per PR review) and have failed on clean main since. Replace them with a regression test asserting the field does NOT appear when a URL is entered. Co-Authored-By: Claude Fable 5 --- test/screens/create_post_screen_test.dart | 30 ++++++----------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/test/screens/create_post_screen_test.dart b/test/screens/create_post_screen_test.dart index 67f726e..9acf686 100644 --- a/test/screens/create_post_screen_test.dart +++ b/test/screens/create_post_screen_test.dart @@ -176,11 +176,13 @@ void main() { expect(switchAfter.value, true); }); - testWidgets('should show thumbnail field when URL is entered', (tester) async { + testWidgets( + 'should not show a thumbnail field when URL is entered ' + '(thumb removed from ExternalEmbedInput in 746df36)', (tester) async { await tester.pumpWidget(createTestWidget()); await tester.pumpAndSettle(); - // Initially no thumbnail field + // No thumbnail field before entering a URL expect(find.widgetWithText(TextField, 'Thumbnail URL'), findsNothing); // Enter a URL @@ -190,28 +192,10 @@ void main() { ); await tester.pumpAndSettle(); - // Thumbnail field should now be visible - expect(find.widgetWithText(TextField, 'Thumbnail URL'), findsOneWidget); - }); - - testWidgets('should hide thumbnail field when URL is cleared', (tester) async { - await tester.pumpWidget(createTestWidget()); - await tester.pumpAndSettle(); - - // Enter a URL - final urlField = find.widgetWithText(TextField, 'URL'); - await tester.enterText(urlField, 'https://example.com'); - await tester.pumpAndSettle(); - - // Thumbnail field should be visible - expect(find.widgetWithText(TextField, 'Thumbnail URL'), findsOneWidget); - - // Clear the URL - await tester.enterText(urlField, ''); - await tester.pumpAndSettle(); - - // Thumbnail field should be hidden + // Still no thumbnail field — the backend derives thumbnails itself expect(find.widgetWithText(TextField, 'Thumbnail URL'), findsNothing); + // The URL text was accepted into the URL field + expect(find.text('https://example.com'), findsOneWidget); }); testWidgets('should display close button', (tester) async { -- 2.51.2