Skip to content

Commit a1cc331

Browse files
author
Martin Krulis
committed
Making sure test names are trimmed in config form before sending them to API.
1 parent 4a07575 commit a1cc331

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/helpers/exercise/tests.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,18 @@ export const transformTestsValues = formData => {
4242
let tests = [];
4343

4444
for (const test of formData.tests) {
45+
const testName = test.name.trim();
4546
const testWeight = uniformScore ? 100 : Number(test.weight);
46-
scoreConfigData.testWeights[test.name] = testWeight;
47+
scoreConfigData.testWeights[testName] = testWeight;
4748

4849
tests.push(
4950
test.id
5051
? {
5152
id: test.id,
52-
name: test.name,
53+
name: testName,
5354
}
5455
: {
55-
name: test.name,
56+
name: testName,
5657
}
5758
);
5859
}

0 commit comments

Comments
 (0)