From a78885163c230010ef441fe3879ff7d7f999097c Mon Sep 17 00:00:00 2001 From: Dan Holmes Date: Thu, 3 Dec 2020 13:53:23 +0000 Subject: [PATCH] Add test for max quality --- js-jasmine/spec/shop_spec.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js-jasmine/spec/shop_spec.js b/js-jasmine/spec/shop_spec.js index e4c53827..ae5ef64c 100644 --- a/js-jasmine/spec/shop_spec.js +++ b/js-jasmine/spec/shop_spec.js @@ -14,23 +14,27 @@ describe('Shop', () => { expect(items[0].name).toEqual('foo'); }); it('decreases sellIn by 1', () => { + item.name = 'foo'; item.sellIn = 5; const items = gildedRose.updateQuality(); expect(items[0].sellIn).toEqual(5 - 1); }); it('decreases qualtiy by 1', () => { + item.name = 'foo'; item.sellIn = 5; item.quality = 5; const items = gildedRose.updateQuality(); expect(items[0].quality).toEqual(5 - 1); }); it('when sell by passed, decreases quality by 2', () => { + item.name = 'foo'; item.sellIn = 0; item.quality = 5; const items = gildedRose.updateQuality(); expect(items[0].quality).toEqual(5 - 2); }); it('will not reduce quality below 0', () => { + item.name = 'foo'; item.quality = 0; const items = gildedRose.updateQuality(); expect(items[0].quality).toEqual(0);