Skip to content

Commit

Permalink
Merge pull request freeCodeCamp#11594 from ashleypt/fix/isCommingSoon…
Browse files Browse the repository at this point in the history
…-typofix

Fixed typo in utils.js filterComingSoonBetaChallenge
  • Loading branch information
dhcodes authored Nov 9, 2016
2 parents c4611c9 + 2faadff commit ef64c55
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions common/app/routes/challenges/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
) {
Expand All @@ -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)
Expand Down
18 changes: 9 additions & 9 deletions common/app/routes/challenges/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
getNextChallenge,
getFirstChallengeOfNextBlock,
getFirstChallengeOfNextSuperBlock,
filterCommingSoonBetaChallenge,
filterComingSoonBetaChallenge,
filterComingSoonBetaFromEntities,
createMapUi,
traverseMapUi,
Expand Down Expand Up @@ -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 }
));
Expand Down
2 changes: 1 addition & 1 deletion server/services/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit ef64c55

Please sign in to comment.