From 9baef49e6721420fc72c8e0c369db45d0b1573e0 Mon Sep 17 00:00:00 2001 From: hmartiins Date: Thu, 2 Jan 2025 00:04:24 -0300 Subject: [PATCH] test: ensure HttpClient request with correct queryStrings and params --- test/infra/api/clients/http_client_test.dart | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/infra/api/clients/http_client_test.dart b/test/infra/api/clients/http_client_test.dart index 4e93cf3..b6d522c 100644 --- a/test/infra/api/clients/http_client_test.dart +++ b/test/infra/api/clients/http_client_test.dart @@ -106,5 +106,17 @@ void main() { expect(client.url, '$url?q1=value1&q2=value2'); }); + + test('should request with correct queryStrings and params', () async { + url = 'http://anyurl.com/api/:p1/:p2'; + + await sut.get( + url: url, + params: {'p1': 'v1', 'p2': 'v2'}, + queryString: {'q1': 'v3', 'q2': 'v4'}, + ); + + expect(client.url, 'http://anyurl.com/api/v1/v2?q1=v3&q2=v4'); + }); }); }