Added Tests for (/lib/utils): 100% Coverage

This commit is contained in:
Manas Hejmadi
2025-07-06 21:20:11 +05:30
parent d373d171ab
commit bf21ccdc98
9 changed files with 468 additions and 184 deletions

View File

@@ -124,4 +124,22 @@ void main() {
},
);
});
group("Testing removeKeyContentType() function", () {
test('Removes lowercase content-type key', () {
Map<String, String> header1 = {
"content-type": "application/json",
"authorization": "Bearer token",
};
header1.removeKeyContentType();
expect(header1.containsKey("content-type"), false);
expect(header1.containsKey("authorization"), true);
});
test('Preserves original map after mutation', () {
final header4 = {"Content-Type": "application/json", "X-Custom": "value"};
final result = header4.removeKeyContentType();
expect(identical(result, header4), true);
});
});
}