Fixed typo in utils.js filterComingSoonBetaChallenge

This commit is contained in:
Ashley Perpetual
2016-11-09 11:14:56 +08:00
parent c4611c9446
commit 2faadffc3d
3 changed files with 12 additions and 12 deletions

View File

@ -257,7 +257,7 @@ export function getMouse(e, [dx, dy]) {
return [pageX - dx, pageY - dy]; return [pageX - dx, pageY - dy];
} }
export function filterCommingSoonBetaChallenge( export function filterComingSoonBetaChallenge(
isDev = false, isDev = false,
{ isComingSoon, isBeta } { isComingSoon, isBeta }
) { ) {
@ -269,7 +269,7 @@ export function filterComingSoonBetaFromEntities(
{ challenge: challengeMap, ...rest }, { challenge: challengeMap, ...rest },
isDev = false isDev = false
) { ) {
const filter = filterCommingSoonBetaChallenge.bind(null, isDev); const filter = filterComingSoonBetaChallenge.bind(null, isDev);
return { return {
...rest, ...rest,
challenge: Object.keys(challengeMap) challenge: Object.keys(challengeMap)

View File

@ -4,7 +4,7 @@ import {
getNextChallenge, getNextChallenge,
getFirstChallengeOfNextBlock, getFirstChallengeOfNextBlock,
getFirstChallengeOfNextSuperBlock, getFirstChallengeOfNextSuperBlock,
filterCommingSoonBetaChallenge, filterComingSoonBetaChallenge,
filterComingSoonBetaFromEntities, filterComingSoonBetaFromEntities,
createMapUi, createMapUi,
traverseMapUi, traverseMapUi,
@ -860,29 +860,29 @@ test('common/app/routes/challenges/utils', function(t) {
); );
}); });
}); });
t.test('filterCommingSoonBetaChallenge', t => { t.test('filterComingSoonBetaChallenge', t => {
t.plan(4); t.plan(4);
t.test('should return true when not coming-soon/beta', t => { t.test('should return true when not coming-soon/beta', t => {
let isDev; let isDev;
t.ok(filterCommingSoonBetaChallenge(isDev, {})); t.ok(filterComingSoonBetaChallenge(isDev, {}));
t.ok(filterCommingSoonBetaChallenge(true, {})); t.ok(filterComingSoonBetaChallenge(true, {}));
t.end(); t.end();
}); });
t.test('should return false when isComingSoon', t => { t.test('should return false when isComingSoon', t => {
let isDev; let isDev;
t.notOk(filterCommingSoonBetaChallenge(isDev, { isComingSoon: true })); t.notOk(filterComingSoonBetaChallenge(isDev, { isComingSoon: true }));
t.end(); t.end();
}); });
t.test('should return false when isBeta', t => { t.test('should return false when isBeta', t => {
let isDev; let isDev;
t.notOk(filterCommingSoonBetaChallenge(isDev, { isBeta: true })); t.notOk(filterComingSoonBetaChallenge(isDev, { isBeta: true }));
t.end(); t.end();
}); });
t.test('should always return true when in dev', t => { t.test('should always return true when in dev', t => {
let isDev = true; let isDev = true;
t.ok(filterCommingSoonBetaChallenge(isDev, { isBeta: true })); t.ok(filterComingSoonBetaChallenge(isDev, { isBeta: true }));
t.ok(filterCommingSoonBetaChallenge(isDev, { isComingSoon: true })); t.ok(filterComingSoonBetaChallenge(isDev, { isComingSoon: true }));
t.ok(filterCommingSoonBetaChallenge( t.ok(filterComingSoonBetaChallenge(
isDev, isDev,
{ isBeta: true, isCompleted: true } { isBeta: true, isCompleted: true }
)); ));

View File

@ -9,7 +9,7 @@ const challengesRegex = /^(bonfire|waypoint|zipline|basejump|checkpoint)/i;
const log = debug('fcc:services:map'); const log = debug('fcc:services:map');
// if challenge is not isComingSoon or isBeta => load // if challenge is not isComingSoon or isBeta => load
// if challenge is commingSoon we are in beta||dev => load // if challenge is ComingSoon we are in beta||dev => load
// if challenge is beta and we are in beta||dev => load // if challenge is beta and we are in beta||dev => load
// else hide // else hide
function loadComingSoonOrBetaChallenge({ function loadComingSoonOrBetaChallenge({