Skip to content

Commit

Permalink
test: ensure HttpClient request with correct queryStrings and params
Browse files Browse the repository at this point in the history
  • Loading branch information
hmartiins committed Jan 2, 2025
1 parent dbec932 commit 9baef49
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/infra/api/clients/http_client_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
});
}

0 comments on commit 9baef49

Please sign in to comment.