diff --git a/lib/NightwaveChallenge.js b/lib/NightwaveChallenge.js index 37d14c82e..280965d3d 100644 --- a/lib/NightwaveChallenge.js +++ b/lib/NightwaveChallenge.js @@ -23,7 +23,7 @@ class NightwaveChallenge extends WorldstateObject { * Whether or not this is a daily challenge * @type {Boolean} */ - this.isDaily = data.Daily; + this.isDaily = data.Daily || false; /** * Whether or not the challenge is an elite challenge diff --git a/test/unit/nightwave.spec.js b/test/unit/nightwave.spec.js index 196b38334..0c7dc4ec0 100644 --- a/test/unit/nightwave.spec.js +++ b/test/unit/nightwave.spec.js @@ -4,6 +4,7 @@ const chai = require('chai'); chai.should(); +const { expect } = require('chai'); const Nightwave = require('../../lib/Nightwave'); const mdConfig = require('../data/markdown.json'); const nwdata = require('../data/Nightwave.json'); @@ -33,5 +34,12 @@ describe('Nightwave', () => { new Nightwave(nwdata, deps); }).should.not.throw(); }); + it('isDaily should be present', () => { + (() => { + const n = new Nightwave(nwdata, deps); + const challenges = n.possibleChallenges.concat(n.activeChallenges); + challenges.forEach((e) => expect(typeof e.isDaily !== 'undefined').to.be.true); + }).should.not.throw(); + }); }); });