Skip to content

Commit

Permalink
test creados para los métodos de #10 #27 #38 #43
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelfdez99 committed Dec 27, 2020
1 parent 62b952d commit 42eb557
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions test/myoutlet.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ store.addItem(nItem1);
store.addItem(nItem2);
store.addAccessory(nAccessory);
store.addAccessory(nAccessory1);
const brand = "";

describe("Testing MyOutlet:", function(){

Expand All @@ -33,6 +34,20 @@ describe("Testing deleteItem", function() {
});
});

describe("Testing updateItem", function() {
it("should update an item", function() {
type = "T-SHIRT"
let newItem = new Item(type, "L", "JOMA", "GREEN", 25, "SPRING_SUMMER");
store.addItem(newItem);
let i = store.updatedItem(type, "S", "KAPPA", "WHITE", 30, "FALL_WINTER");
assert.equal(newItem.getBrand(), "KAPPA");
assert.equal(newItem.getSize(), "S");
assert.equal(newItem.getPrice(), 30);
});
});



describe("Testing getItem" , function() {
it("should get an item", function(){
let i = store.getItem();
Expand Down Expand Up @@ -77,4 +92,35 @@ describe("Testing deleteItem", function() {
assert.equal(store.accessories[0], nAccessory);
});
});

describe("Testing brandInfo", function() {
it("should return information of certain brand", function() {
var i = store.brandInfo("FILA");
var j =
"Type:" + "JEANS" + ", " +
"Size: " + "XL" + ", " +
"Color: " + "BLUE" + ", " +
"Price: " + "50" + ", " +
"Season: " + "FALL_WINTER" + " ";
assert.equal(i,j)
})
})

describe("Testing seasonType", function() {
it("should return the types existing in a season", function() {
var i = store.seasonType("SPRING_SUMMER")
assert.equal(i,"T-SHIRT");
})
})

describe("Testing showAccessories", function(){
it("should return info about every accessory" , function(){
var i = store.showAccessories().length;
var j = store.accessories.length;
assert.equal(i,j);
})
});



});

0 comments on commit 42eb557

Please sign in to comment.