Skip to content

Commit e588aba

Browse files
square-tombclaude
andcommitted
test(mobile): fold escaped attachment case into the bubble journey
Per review, cover escaped attachment segmentation in the existing attachments-stay-outside-bubbles journey instead of a standalone test. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Tom Brow <[email protected]>
1 parent 214160a commit e588aba

2 files changed

Lines changed: 3 additions & 45 deletions

File tree

‎mobile/test/features/channels/message_content_bubble_cases.dart‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,10 @@ void bubbleContentTests() {
240240
_testable(
241241
const MessageContent(
242242
content:
243-
'Before\n\n[file.txt](https://example.com/file.txt)\n\nAfter',
243+
// The escaped destination must still match its plain imeta URL.
244+
'Before\n\n[file.txt](https://example.com/file\\_a.txt)\n\nAfter',
244245
tags: [
245-
['imeta', 'url https://example.com/file.txt', 'm text/plain'],
246+
['imeta', 'url https://example.com/file_a.txt', 'm text/plain'],
246247
],
247248
bubble: true,
248249
),

‎mobile/test/features/channels/message_content_test.dart‎

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import 'package:buzz/features/channels/channels_provider.dart';
2727
import 'package:buzz/features/channels/message_content.dart';
2828
import 'package:buzz/features/channels/media_viewer_page.dart';
2929
import 'package:buzz/features/channels/voice_note_attachment.dart';
30-
import 'package:buzz/shared/widgets/message_attachment_corners.dart';
3130
import 'package:buzz/features/channels/voice_note_waveform.dart';
3231
import 'package:buzz/features/channels/voice_note_recording.dart';
3332
import 'package:buzz/shared/deeplink/deep_link.dart';
@@ -1613,48 +1612,6 @@ void main() {
16131612
expect(find.text('voice-note-desktop.mp4'), findsNothing);
16141613
});
16151614

1616-
testWidgets('splits an escaped voice-note link into its own segment', (
1617-
tester,
1618-
) async {
1619-
const url = 'https://example.com/media/voice_note.mp4';
1620-
1621-
await tester.pumpWidget(
1622-
_testable(
1623-
const MessageContent(
1624-
content:
1625-
'before\n[voice.mp4](https://example.com/media/voice\\_note.mp4)\n'
1626-
'after',
1627-
bubble: true,
1628-
tags: [
1629-
[
1630-
'imeta',
1631-
'url $url',
1632-
'm video/mp4',
1633-
'duration 3.0',
1634-
'filename voice-note-escaped.mp4',
1635-
],
1636-
],
1637-
),
1638-
overrides: [
1639-
voiceNotePlayerFactoryProvider.overrideWithValue(
1640-
_FakeVoiceNotePlayer.new,
1641-
),
1642-
],
1643-
),
1644-
);
1645-
await tester.pump();
1646-
1647-
final card = find.byKey(const ValueKey('voice-note-attachment:$url'));
1648-
expect(card, findsOneWidget);
1649-
expect(
1650-
find.ancestor(
1651-
of: card,
1652-
matching: find.byType(MessageAttachmentCorners),
1653-
),
1654-
findsOneWidget,
1655-
);
1656-
});
1657-
16581615
testWidgets('keeps audio-looking links without imeta as ordinary links', (
16591616
tester,
16601617
) async {

0 commit comments

Comments
 (0)