Skip to content

Commit 0ef5a80

Browse files
committed
update
1 parent 9a6130d commit 0ef5a80

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

lib/utils/envvar_utils.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,11 @@ HttpRequestModel substituteHttpRequestModel(
8686
value: substituteVariables(param.value, envMap, activeEnvironmentId),
8787
);
8888
}).toList(),
89-
body: substituteVariables(httpRequestModel.body, envMap, activeEnvironmentId),
89+
body: substituteVariables(
90+
httpRequestModel.body,
91+
envMap,
92+
activeEnvironmentId,
93+
),
9094
);
9195
return newRequestModel;
9296
}

test/utils/envvar_utils_test.dart

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,12 @@ void main() {
211211
NameValueModel(name: "num", value: "{{num}}"),
212212
],
213213
);
214+
214215
Map<String?, List<EnvironmentVariableModel>> envMap = {
215216
kGlobalEnvironmentId: globalVars,
216217
"activeEnvId": activeEnvVars,
217218
};
219+
218220
String? activeEnvironmentId = "activeEnvId";
219221
const expected = HttpRequestModel(
220222
url: "api.apidash.dev/humanize/social",
@@ -227,7 +229,10 @@ void main() {
227229
);
228230
expect(
229231
substituteHttpRequestModel(
230-
httpRequestModel, envMap, activeEnvironmentId),
232+
httpRequestModel,
233+
envMap,
234+
activeEnvironmentId,
235+
),
231236
expected);
232237
});
233238

@@ -260,7 +265,10 @@ void main() {
260265
httpRequestModel, envMap, activeEnvironmentId),
261266
expected);
262267
});
263-
test("Testing substituteHttpRequestModel with environment variables in body", () {
268+
269+
test(
270+
"Testing substituteHttpRequestModel with environment variables in body",
271+
() {
264272
const httpRequestModel = HttpRequestModel(
265273
url: "{{url}}/humanize/social",
266274
headers: [
@@ -287,7 +295,8 @@ void main() {
287295
body: "The API key is token and the number is 8940000",
288296
);
289297
expect(
290-
substituteHttpRequestModel(httpRequestModel, envMap, activeEnvironmentId),
298+
substituteHttpRequestModel(
299+
httpRequestModel, envMap, activeEnvironmentId),
291300
expected);
292301
});
293302
});

0 commit comments

Comments
 (0)