chore: remove obsolete tests, add design docs and PRD
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,34 +0,0 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:http/testing.dart';
|
||||
import 'package:pad_scanner/services/api_service.dart';
|
||||
|
||||
void main() {
|
||||
group('ApiService', () {
|
||||
test('sendScanData returns true on 200', () async {
|
||||
final client = MockClient((request) async {
|
||||
return http.Response('{"status":"ok"}', 200);
|
||||
});
|
||||
final service = ApiService(client: client);
|
||||
final result = await service.sendScanData(
|
||||
'http://localhost:8000/scan',
|
||||
barcode: '123456',
|
||||
codeType: 'CODE128',
|
||||
);
|
||||
expect(result, isTrue);
|
||||
});
|
||||
|
||||
test('sendScanData returns false on error', () async {
|
||||
final client = MockClient((request) async {
|
||||
return http.Response('error', 500);
|
||||
});
|
||||
final service = ApiService(client: client);
|
||||
final result = await service.sendScanData(
|
||||
'http://localhost:8000/scan',
|
||||
barcode: '123456',
|
||||
codeType: 'CODE128',
|
||||
);
|
||||
expect(result, isFalse);
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user