Skip to content

Commit

Permalink
Making sure test names are trimmed in config form before sending them…
Browse files Browse the repository at this point in the history
… to API.
  • Loading branch information
Martin Krulis committed Apr 19, 2019
1 parent 4a07575 commit a1cc331
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/helpers/exercise/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,18 @@ export const transformTestsValues = formData => {
let tests = [];

for (const test of formData.tests) {
const testName = test.name.trim();
const testWeight = uniformScore ? 100 : Number(test.weight);
scoreConfigData.testWeights[test.name] = testWeight;
scoreConfigData.testWeights[testName] = testWeight;

tests.push(
test.id
? {
id: test.id,
name: test.name,
name: testName,
}
: {
name: test.name,
name: testName,
}
);
}
Expand Down

0 comments on commit a1cc331

Please sign in to comment.