Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Nightwave challenge isDaily default to false #430

Merged
merged 2 commits into from
Jan 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
TobiTenno marked this conversation as resolved.
Show resolved Hide resolved

/**
* 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();
});
});
});