Skip to content

Commit

Permalink
fix(tests): content coverage for wacky pots
Browse files Browse the repository at this point in the history
  • Loading branch information
SabreCat committed Apr 9, 2019
1 parent 7884f4c commit a486ded
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
5 changes: 3 additions & 2 deletions test/content/hatching-potions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ import hatchingPotions from '../../website/common/script/content/hatching-potion

describe('hatchingPotions', () => {
describe('all', () => {
it('is a combination of drop and premium potions', () => {
it('is a combination of drop, premium, and wacky potions', () => {
let dropNumber = Object.keys(hatchingPotions.drops).length;
let premiumNumber = Object.keys(hatchingPotions.premium).length;
let wackyNumber = Object.keys(hatchingPotions.wacky).length;
let allNumber = Object.keys(hatchingPotions.all).length;

expect(allNumber).to.be.greaterThan(0);
expect(allNumber).to.equal(dropNumber + premiumNumber);
expect(allNumber).to.equal(dropNumber + premiumNumber + wackyNumber);
});

it('contains basic information about each potion', () => {
Expand Down
15 changes: 14 additions & 1 deletion test/content/stable.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,18 @@ describe('stable', () => {
});
});

describe('wackyPets', () => {
it('contains a pet for each wacky potion * each drop egg', () => {
let numberOfWackyPotions = Object.keys(potions.wacky).length;
let numberOfDropEggs = Object.keys(eggs.drops).length;
let numberOfWackyPets = Object.keys(stable.wackyPets).length;
let expectedTotal = numberOfWackyPotions * numberOfDropEggs;

expect(numberOfWackyPets).to.be.greaterThan(0);
expect(numberOfWackyPets).to.equal(expectedTotal);
});
});

describe('specialPets', () => {
it('each value is a valid translation string', () => {
each(stable.specialPets, (pet) => {
Expand Down Expand Up @@ -107,10 +119,11 @@ describe('stable', () => {
let questNumber = Object.keys(stable.questPets).length;
let specialNumber = Object.keys(stable.specialPets).length;
let premiumNumber = Object.keys(stable.premiumPets).length;
let wackyNumber = Object.keys(stable.wackyPets).length;
let allNumber = Object.keys(stable.petInfo).length;

expect(allNumber).to.be.greaterThan(0);
expect(allNumber).to.equal(dropNumber + questNumber + specialNumber + premiumNumber);
expect(allNumber).to.equal(dropNumber + questNumber + specialNumber + premiumNumber + wackyNumber);
});

it('contains basic information about each pet', () => {
Expand Down

0 comments on commit a486ded

Please sign in to comment.