Advertisement
bebo231312312321

Untitled

Jun 9th, 2023
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. describe("Tests weddingDay", () => {
  3.     describe("Tests pickVenue", () => {
  4.       it("Test for empty string", () => {
  5.         expect(() => {weddingDay.pickVenue(1, 2, "")}).to.throw(
  6.           "Invalid Information!"
  7.         );
  8.       });
  9.       it("Test for incorrect capacity, pricePerGuest and string", () => {
  10.         expect(() => {weddingDay.pickVenue("1", 2, "")}).to.throw(
  11.           "Invalid Information!"
  12.         );
  13.       });
  14.       it("Test for incorrect capacity, pricePerGuest and string", () => {
  15.         expect(() => {weddingDay.pickVenue(1, "2", "")}).to.throw(
  16.           "Invalid Information!"
  17.         );
  18.       });
  19.    
  20.       it("Test for incorrect capacity, pricePerGuest and string", () => {
  21.         expect(() => {weddingDay.pickVenue(1, "2", "[]")}).to.throw(
  22.           "Invalid Information!"
  23.         );
  24.       });
  25.       it("Test for incorrect  location", () => {
  26.         expect(() => {weddingDay.pickVenue(1, 2, "Bourgas")}).to.throw(
  27.           "The location of this venue is not in the correct area!"
  28.         );
  29.       });
  30.       it("Place selection test with min and max boudary", () => {
  31.         expect(weddingDay.pickVenue(150, 120, "Varna")).to.equal(
  32.           "This venue meets the requirements, with capacity of 150 guests and 120$ cover."
  33.         );
  34.       });
  35.       it("Place selection test in boudary", () => {
  36.         expect(weddingDay.pickVenue(151, 112, "Varna")).to.equal(
  37.           "This venue meets the requirements, with capacity of 151 guests and 112$ cover."
  38.         );
  39.       });
  40.       it("Place selection test out of boudary", () => {
  41.         expect(weddingDay.pickVenue(149, 121, "Varna")).to.equal(
  42.           "This venue does not meet your requirements!"
  43.         );
  44.       });
  45.     });
  46.  
  47.     describe("Tests tableDistribution", () => {
  48.       it("Test for guest and tables are not number or are a negative numbers", () => {
  49.         expect(() => {weddingDay.tableDistribution("1", 1)}).to.throw(
  50.           "Invalid Information!"
  51.         );
  52.         expect(() => {weddingDay.tableDistribution("1", "1")}).to.throw(
  53.           "Invalid Information!"
  54.         );
  55.         expect(() => {weddingDay.tableDistribution(1, "1")}).to.throw(
  56.           "Invalid Information!"
  57.         );
  58.         expect(() => {weddingDay.tableDistribution(1, [1])}).to.throw(
  59.           "Invalid Information!"
  60.         );
  61.       });
  62.       it("tests for less than 6 people on each table", () => {
  63.         expect(weddingDay.tableDistribution(100, 20)).to.equal(
  64.           "There is only 5 people on every table, you can join some tables."
  65.         );
  66.       });
  67.       it("tests for greater than 6 people on each table", () => {
  68.         expect(weddingDay.tableDistribution(100, 10)).to.equal(
  69.           "You have 10 tables with 10 guests on table."
  70.         );
  71.       });
  72.     });
  73.     it('otherSpendings', () => {
  74.         expect(() => weddingDay.otherSpendings({}, {}, {})).to.throw();
  75.         expect(() => weddingDay.otherSpendings([], {}, {})).to.throw();
  76.         expect(() => weddingDay.otherSpendings([], [], {})).to.throw();
  77.         expect(() => weddingDay.otherSpendings('', [], true)).to.throw();
  78.         expect(() => weddingDay.otherSpendings([], [], true)).to.not.throw();
  79.         expect(weddingDay.otherSpendings(['flowers', 'Fabric drapes and curtains'], ['pictures', 'video'], false)).to.equal(
  80.           'You spend 2900$ for wedding decoration and photography!'
  81.         );
  82.         expect(weddingDay.otherSpendings(['flowers'], ['pictures'], false)).to.equal(
  83.           'You spend 1200$ for wedding decoration and photography!'
  84.         );
  85.         expect(weddingDay.otherSpendings(['Fabric drapes and curtains'], ['video'], false)).to.equal(
  86.           'You spend 1700$ for wedding decoration and photography!'
  87.         );
  88.         expect(weddingDay.otherSpendings(['flowers', 'Fabric drapes and curtains'], ['pictures', 'video'], true)).to.equal(
  89.           'You spend 2465$ for wedding decoration and photography with 15% discount!'
  90.         );
  91.         expect(weddingDay.otherSpendings(['flowers'], ['pictures'], true)).to.equal(
  92.           'You spend 1020$ for wedding decoration and photography with 15% discount!'
  93.         );
  94.         expect(weddingDay.otherSpendings(['Fabric drapes and curtains'], ['video'], true)).to.equal(
  95.           'You spend 1445$ for wedding decoration and photography with 15% discount!'
  96.         );
  97.       });
  98.   });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement