Advertisement
Liliana797979

pizza place - js advanced exam

Dec 10th, 2021
897
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. describe("pizza", function() {
  2.  
  3.     describe("makeAnOrder", function() {
  4.  
  5.  
  6.  
  7.         it("Should return Correct w/ food & drink", function() {
  8.  
  9.             chai.assert.equal(makeAnOrder({orderedPizza: "the name of the pizza", orderedDrink: "the name of the drink"}),"You just ordered the name of the pizza and the name of the drink.");
  10.  
  11.         });
  12.  
  13.  
  14.  
  15.         it("Should return Correct w/ food", function() {
  16.  
  17.             chai.assert.equal(makeAnOrder({orderedPizza: "the name of the pizza."}),"You just ordered the name of the pizza.");
  18.  
  19.         });
  20.  
  21.  
  22.  
  23.         it("Should return Error when !orderedPizza", function() { //HOW TO MAKE AN ERROR!
  24.  
  25.             chai.assert.throw(() => {
  26.  
  27.                 makeAnOrder({});
  28.  
  29.             }, 'You must order at least 1 Pizza to finish the order.');
  30.  
  31.         });
  32.  
  33.      });
  34.  
  35.  
  36.  
  37.  
  38.      describe("getRemainingWork", function() {
  39.  
  40.  
  41.  
  42.         it("Should return Correct when READY", function() {
  43.  
  44.             chai.assert.equal(getRemainingWork([{pizzaName: "the name of the pizza", status: "ready"}]), "All orders are complete!");
  45.  
  46.         });
  47.  
  48.  
  49.  
  50.         it("Should return Correct when PREPARING", function() {
  51.  
  52.             chai.assert.equal(getRemainingWork([{pizzaName: "the name of the pizza", status: "preparing"}]), "The following pizzas are still preparing: the name of the pizza.");
  53.  
  54.         });
  55.  
  56.      });
  57.  
  58.  
  59.  
  60.  
  61.      describe("orderType", function() {
  62.  
  63.  
  64.  
  65.         it("Should return Correct when CARRY OUT", function() {
  66.  
  67.             chai.assert.equal(orderType(50, "Carry Out"), 45);
  68.  
  69.         });
  70.  
  71.  
  72.  
  73.         it("Should return Correct when DELIVERY", function() {
  74.  
  75.             chai.assert.equal(orderType(50, "Delivery"), 50);
  76.  
  77.         });
  78.  
  79.      });
  80.  
  81. });
  82.  
  83.  
  84.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement