v1.0.16 utf8 decoding

This commit is contained in:
Tibor Bossanyi
2023-03-19 19:14:48 +01:00
parent f2f70a6db9
commit 27299ed266
5 changed files with 34 additions and 16 deletions
+18 -2
View File
@@ -1,3 +1,5 @@
import 'dart:convert';
import 'package:flutter_test/flutter_test.dart';
import 'package:workouttest_util/model/cache.dart';
import 'package:workouttest_util/service/api.dart';
@@ -9,7 +11,6 @@ main() {
});
group('api', () {
test('connect api auth successfully', () async {
var api = APIClient();
var responseJson = await api.authenticateUser("bosi", "andio2009");
@@ -27,5 +28,20 @@ main() {
final body = await api.get("app_package", "");
print(body);
});
test('test customer conversation in utf8', () async {
var api = APIWebClient();
var responseJson = await api.authenticateUser("bosi", "andio2009");
print(responseJson);
Cache().authToken = responseJson['token'];
final body = await api.get("customer_conversation/72", "");
List<int> bytes3 = base64.decode(body);
String decodedString = utf8.decode(bytes3);
print(decodedString);
final body2 = await api.get("meal/21", "");
print(body2);
});
});
}
}