mirror of
https://github.com/block/buzz.git
synced 2026-10-27 04:30:52 +00:00
Signed-off-by: Wes <wesbillman@users.noreply.github.com> Co-authored-by: Pinky <44b8e82baa6e0e254e0208d68f335c283c94e7b78dd1fa10d5a49d3f13dd0435@sprout-oss.stage.blox.sqprod.co>
39 lines
1.1 KiB
Dart
39 lines
1.1 KiB
Dart
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:buzz/features/channels/message_media.dart';
|
|
|
|
void main() {
|
|
group('classifyMediaUrl', () {
|
|
test('treats only mp4 URLs as video fallback', () {
|
|
expect(
|
|
classifyMediaUrl('https://example.com/media/clip.mp4'),
|
|
MessageMediaKind.video,
|
|
);
|
|
expect(classifyMediaUrl('https://example.com/media/clip.mov'), isNull);
|
|
expect(classifyMediaUrl('https://example.com/media/clip.webm'), isNull);
|
|
});
|
|
|
|
test('does not treat non-mp4 video mimetypes as video UI', () {
|
|
expect(
|
|
classifyMediaUrl(
|
|
'https://example.com/media/clip.mov',
|
|
imeta: const ImetaEntry(
|
|
url: 'https://example.com/media/clip.mov',
|
|
mimeType: 'video/quicktime',
|
|
),
|
|
),
|
|
isNull,
|
|
);
|
|
expect(
|
|
classifyMediaUrl(
|
|
'https://example.com/media/clip.mp4',
|
|
imeta: const ImetaEntry(
|
|
url: 'https://example.com/media/clip.mp4',
|
|
mimeType: 'video/mp4',
|
|
),
|
|
),
|
|
MessageMediaKind.video,
|
|
);
|
|
});
|
|
});
|
|
}
|