181186 - Criar PDV Android para rodar em maquinas P.O.S.
This commit is contained in:
commit
c9983cbad5
204 files changed
+11453
No files matched your search
@@ -0,0 +1,38 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:pdv/core/config/server_url_validator.dart';
|
||||
|
||||
void main() {
|
||||
group('ServerUrlValidator', () {
|
||||
test('aceita URL HTTPS com host', () {
|
||||
expect(ServerUrlValidator.validate('https://odoo.example.com'), isNull);
|
||||
});
|
||||
|
||||
test('rejeita URL HTTP sem criptografia', () {
|
||||
expect(
|
||||
ServerUrlValidator.validate(
|
||||
'http://odoo.example.com',
|
||||
requireHttps: true,
|
||||
),
|
||||
contains('HTTPS'),
|
||||
);
|
||||
});
|
||||
|
||||
test('aceita HTTP por padrão nas configurações', () {
|
||||
expect(ServerUrlValidator.validate('http://odoo.local'), isNull);
|
||||
});
|
||||
|
||||
test('permite HTTP quando HTTPS não é obrigatório', () {
|
||||
expect(
|
||||
ServerUrlValidator.validate(
|
||||
'http://odoo.local',
|
||||
requireHttps: false,
|
||||
),
|
||||
isNull,
|
||||
);
|
||||
});
|
||||
|
||||
test('rejeita URL sem host', () {
|
||||
expect(ServerUrlValidator.validate('https://'), isNotNull);
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user