Skip to content

Commit

Permalink
fix: Nightwave challenge isDaily default to false (#430)
Browse files Browse the repository at this point in the history
  • Loading branch information
SlayerOrnstein authored Jan 19, 2023
1 parent 2a93e55 commit e0f19aa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/NightwaveChallenge.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions test/unit/nightwave.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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();
});
});
});

0 comments on commit e0f19aa

Please sign in to comment.