diff --git a/TypeScript/test/gilded-rose.spec.ts b/TypeScript/test/gilded-rose.spec.ts index f826bdad..6b42e57e 100644 --- a/TypeScript/test/gilded-rose.spec.ts +++ b/TypeScript/test/gilded-rose.spec.ts @@ -1,6 +1,8 @@ import { expect } from 'chai'; import { Item, GildedRose } from '../app/gilded-rose'; + +// General Tests to ensure it works for newly created item describe('Gilded Rose', function () { it('should foo', function() { @@ -29,6 +31,37 @@ describe('Gilded Rose', function () { }); }); +// tests to check if specific items work correctly + +describe('Backstage Pass', function () { + it('Backstage pass should increase in quality by 2 with only 10 days left', function () { + const gildedRose = new GildedRose ([ new Item('Backstage passes to a TAFKAL80ETC concert', 10, 5)]); + const items = gildedRose.updateQuality(); + expect(items[0].quality).to.equal(7); + }) +}) + +describe('Backstage Pass', function () { + it('Backstage pass should increase in quality by 3 with 5 days left', function () { + const gildedRose = new GildedRose ([ new Item('Backstage passes to a TAFKAL80ETC concert', 5, 5)]); + const items = gildedRose.updateQuality(); + expect(items[0].quality).to.equal(8); + }) +}) +describe('Backstage Pass', function () { + it('Backstage pass should increase in quality by 3, but quality is at 49', function () { + const gildedRose = new GildedRose ([ new Item('Backstage passes to a TAFKAL80ETC concert', 4, 49)]); + const items = gildedRose.updateQuality(); + expect(items[0].quality).to.equal(50); + }) +}) +describe('Backstage Pass', function () { + it('Backstage pass quality should drop to 0 after concert', function () { + const gildedRose = new GildedRose ([ new Item('Backstage passes to a TAFKAL80ETC concert', 0, 50)]); + const items = gildedRose.updateQuality(); + expect(items[0].quality).to.equal(0); + }) +}) \ No newline at end of file