Initial commit: watch-together phases 0-4 + presence hardening, internet-tested
This commit is contained in:
commit
427d851a5b
101 files changed
+11326
No files matched your search
@@ -0,0 +1,33 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:watch_together/src/widgets/media_input.dart';
|
||||
|
||||
void main() {
|
||||
test('http url routes to linkUrl', () {
|
||||
expect(parseMediaInput('http://example.com/v.mp4'),
|
||||
(mediaPath: '', linkUrl: 'http://example.com/v.mp4'));
|
||||
});
|
||||
|
||||
test('https url routes to linkUrl', () {
|
||||
expect(parseMediaInput('https://example.com/v.mp4'),
|
||||
(mediaPath: '', linkUrl: 'https://example.com/v.mp4'));
|
||||
});
|
||||
|
||||
test('scheme match is case-insensitive and trimmed', () {
|
||||
expect(parseMediaInput(' HTTPS://example.com/v.mp4 '),
|
||||
(mediaPath: '', linkUrl: 'HTTPS://example.com/v.mp4'));
|
||||
});
|
||||
|
||||
test('file path routes to mediaPath', () {
|
||||
expect(parseMediaInput('/home/u/Videos/chiyo.mp4'),
|
||||
(mediaPath: '/home/u/Videos/chiyo.mp4', linkUrl: ''));
|
||||
});
|
||||
|
||||
test('empty input stays empty', () {
|
||||
expect(parseMediaInput(' '), (mediaPath: '', linkUrl: ''));
|
||||
});
|
||||
|
||||
test('non-http scheme stays a path', () {
|
||||
expect(parseMediaInput('ftp://example.com/v.mp4'),
|
||||
(mediaPath: 'ftp://example.com/v.mp4', linkUrl: ''));
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user