From 2faadffc3d9ae638c2e8845b01f3408a0f4d36ad Mon Sep 17 00:00:00 2001 From: Ashley Perpetual Date: Wed, 9 Nov 2016 11:14:56 +0800 Subject: [PATCH] Fixed typo in utils.js filterComingSoonBetaChallenge --- common/app/routes/challenges/utils.js | 4 ++-- common/app/routes/challenges/utils.test.js | 18 +++++++++--------- server/services/map.js | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/common/app/routes/challenges/utils.js b/common/app/routes/challenges/utils.js index c73b88837e..8d1f0b6240 100644 --- a/common/app/routes/challenges/utils.js +++ b/common/app/routes/challenges/utils.js @@ -257,7 +257,7 @@ export function getMouse(e, [dx, dy]) { return [pageX - dx, pageY - dy]; } -export function filterCommingSoonBetaChallenge( +export function filterComingSoonBetaChallenge( isDev = false, { isComingSoon, isBeta } ) { @@ -269,7 +269,7 @@ export function filterComingSoonBetaFromEntities( { challenge: challengeMap, ...rest }, isDev = false ) { - const filter = filterCommingSoonBetaChallenge.bind(null, isDev); + const filter = filterComingSoonBetaChallenge.bind(null, isDev); return { ...rest, challenge: Object.keys(challengeMap) diff --git a/common/app/routes/challenges/utils.test.js b/common/app/routes/challenges/utils.test.js index 3c0f716aa8..3030d4bdae 100644 --- a/common/app/routes/challenges/utils.test.js +++ b/common/app/routes/challenges/utils.test.js @@ -4,7 +4,7 @@ import { getNextChallenge, getFirstChallengeOfNextBlock, getFirstChallengeOfNextSuperBlock, - filterCommingSoonBetaChallenge, + filterComingSoonBetaChallenge, filterComingSoonBetaFromEntities, createMapUi, 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.test('should return true when not coming-soon/beta', t => { let isDev; - t.ok(filterCommingSoonBetaChallenge(isDev, {})); - t.ok(filterCommingSoonBetaChallenge(true, {})); + t.ok(filterComingSoonBetaChallenge(isDev, {})); + t.ok(filterComingSoonBetaChallenge(true, {})); t.end(); }); t.test('should return false when isComingSoon', t => { let isDev; - t.notOk(filterCommingSoonBetaChallenge(isDev, { isComingSoon: true })); + t.notOk(filterComingSoonBetaChallenge(isDev, { isComingSoon: true })); t.end(); }); t.test('should return false when isBeta', t => { let isDev; - t.notOk(filterCommingSoonBetaChallenge(isDev, { isBeta: true })); + t.notOk(filterComingSoonBetaChallenge(isDev, { isBeta: true })); t.end(); }); t.test('should always return true when in dev', t => { let isDev = true; - t.ok(filterCommingSoonBetaChallenge(isDev, { isBeta: true })); - t.ok(filterCommingSoonBetaChallenge(isDev, { isComingSoon: true })); - t.ok(filterCommingSoonBetaChallenge( + t.ok(filterComingSoonBetaChallenge(isDev, { isBeta: true })); + t.ok(filterComingSoonBetaChallenge(isDev, { isComingSoon: true })); + t.ok(filterComingSoonBetaChallenge( isDev, { isBeta: true, isCompleted: true } )); diff --git a/server/services/map.js b/server/services/map.js index 46d8fa8307..ba83430efd 100644 --- a/server/services/map.js +++ b/server/services/map.js @@ -9,7 +9,7 @@ const challengesRegex = /^(bonfire|waypoint|zipline|basejump|checkpoint)/i; const log = debug('fcc:services:map'); // 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 // else hide function loadComingSoonOrBetaChallenge({