test(seed): Add Test for Unique Challenge Titles (#17035)
Due to the recent problem with two challenges having the same title, I added a check for unique titles to the test suite so that hopefully won't happen again. Addresses a comment in issue #16906, which was recently closed. BREAKING CHANGE: None Closes #16906
This commit is contained in:
committed by
Stuart Taylor
parent
b208c477fc
commit
5fa098ea0d
@@ -6,9 +6,11 @@ import tape from 'tape';
|
||||
import getChallenges from './getChallenges';
|
||||
import { modern } from '../common/app/utils/challengeTypes';
|
||||
import MongoIds from './mongoIds';
|
||||
import ChallengeTitles from './challengeTitles';
|
||||
import addAssertsToTapTest from './addAssertsToTapTest';
|
||||
|
||||
let mongoIds = new MongoIds();
|
||||
let challengeTitles = new ChallengeTitles();
|
||||
|
||||
function evaluateTest(solution, assert,
|
||||
react, redux, reactRedux,
|
||||
@@ -115,6 +117,7 @@ function createTest({
|
||||
reactRedux = false
|
||||
}) {
|
||||
mongoIds.check(id, title);
|
||||
challengeTitles.check(title);
|
||||
|
||||
solutions = solutions.filter(solution => !!solution);
|
||||
tests = tests.filter(test => !!test);
|
||||
|
Reference in New Issue
Block a user