commit
9c5fef1a4d
412 files changed
+94582
No files matched your search
@@ -0,0 +1,27 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:sakura_mobile/src/core/api_client.dart';
|
||||
|
||||
void main() {
|
||||
group('cloud API base URL normalization', () {
|
||||
test('keeps valid http URL', () {
|
||||
expect(
|
||||
normalizeCloudBaseUrl('http://api.kunkunxiaomao.top:8000'),
|
||||
'http://api.kunkunxiaomao.top:8000',
|
||||
);
|
||||
});
|
||||
|
||||
test('repairs missing slashes after scheme', () {
|
||||
expect(
|
||||
normalizeCloudBaseUrl('http:api.kunkunxiaomao.top:8000'),
|
||||
'http://api.kunkunxiaomao.top:8000',
|
||||
);
|
||||
});
|
||||
|
||||
test('adds http scheme and strips api prefix', () {
|
||||
expect(
|
||||
normalizeCloudBaseUrl('api.kunkunxiaomao.top:8000/api/v1/'),
|
||||
'http://api.kunkunxiaomao.top:8000',
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user