Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added test for dio #223

Merged
merged 15 commits into from
Jul 7, 2024
Merged
3 changes: 3 additions & 0 deletions packages/alice/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 1.0.0-dev.11
* Fixed issue with invalid count of error calls in stats page.

# 1.0.0-dev.10

* [BREAKING_CHANGE] Removed `maxCallsCount`. To change call count, use `storage` constructor parameter
Expand Down
9 changes: 4 additions & 5 deletions packages/alice/lib/ui/stats/alice_stats_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,10 @@ class AliceStatsPage extends StatelessWidget {

/// Returns count of error requests.
int _getErrorRequests() => _calls
.where(
(AliceHttpCall call) =>
(call.response?.status.gte(400) ?? false) &&
(call.response?.status.lt(600) ?? false),
)
.where((AliceHttpCall call) =>
(call.response?.status.gte(400) ?? false) &&
(call.response?.status.lt(600) ?? false) ||
const [-1, 0].contains(call.response?.status))
.toList()
.length;

Expand Down
2 changes: 1 addition & 1 deletion packages/alice/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: alice
description: Alice is an HTTP Inspector tool which helps debugging http requests. It catches and stores http requests and responses, which can be viewed via simple UI.
version: 1.0.0-dev.10
version: 1.0.0-dev.11
homepage: https://github.com/jhomlala/alice
repository: https://github.com/jhomlala/alice
topics:
Expand Down
3 changes: 3 additions & 0 deletions packages/alice_dio/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 1.0.5
* Added tests.

# 1.0.4

* Untrack gitignored files.
Expand Down
1 change: 1 addition & 0 deletions packages/alice_dio/lib/alice_dio_adapter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class AliceDioAdapter extends InterceptorsWrapper with AliceAdapter {
}
request.formDataFields = fields;
}

if (data.files.isNotEmpty == true) {
final files = <AliceFormDataFile>[];
for (var entry in data.files) {
Expand Down
8 changes: 6 additions & 2 deletions packages/alice_dio/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: alice_dio
description: "Alice + Dio integration. It contains plugin for Alice which allows to use Dio package."
version: 1.0.4
version: 1.0.5
repository: https://github.com/jhomlala/alice
homepage: https://github.com/jhomlala/alice
topics:
Expand All @@ -21,4 +21,8 @@ dependencies:
sdk: flutter

dev_dependencies:
flutter_lints: ^4.0.0
flutter_lints: ^4.0.0
test: ^1.25.2
mocktail: ^1.0.4
http_mock_adapter: ^0.6.1
alice_test: ^1.0.0
Loading