forked from turingschool-examples/javascript-foundations
-
Notifications
You must be signed in to change notification settings - Fork 0
/
snack-test.js
69 lines (53 loc) · 1.97 KB
/
snack-test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
var assert = require('chai').assert;
var Snack = require('./snack');
describe('Snack', function() {
it.skip('should be extra delicious', function() {
var pistachio = new Snack("Pistachio");
assert.equal(pistachio.deliciousLevel, "extra");
});
it.skip('should have a type', function() {
var pistachio = new Snack("Pistachio");
var fruitSnack = new Snack("Fruit Snack");
assert.equal(pistachio.type, "Pistachio");
assert.equal(fruitSnack.type, "Fruit Snack");
});
it.skip('should start fully stocked', function() {
var pistachio = new Snack("Pistachio");
assert.equal(pistachio.amount, 100);
});
it.skip('should start NOT inside of a lunch box', function() {
var pistachio = new Snack("Pistachio");
assert.equal(pistachio.isInLunchBox, false);
});
it.skip('should see stock decrease after eaten', function() {
var pistachio = new Snack("Pistachio");
pistachio.getEaten();
pistachio.getEaten();
pistachio.getEaten();
assert.equal(pistachio.amount, 70);
});
it.skip('should be cutting it close if 20% or less remaining', function() {
var pistachio = new Snack("Pistachio");
pistachio.getEaten();
pistachio.getEaten();
pistachio.getEaten();
pistachio.getEaten();
pistachio.getEaten();
pistachio.getEaten();
pistachio.getEaten();
assert.equal(pistachio.cuttingItClose, false);
pistachio.getEaten();
assert.equal(pistachio.cuttingItClose, true);
});
it.skip('should be considered healthy if the word "fruit" is in it', function() {
var pistachio = new Snack("Pistachio");
var mixedFruit = new Snack("Mixed fruit");
var fruit = new Snack("Fruit");
var apple = new Snack("Apple");
assert.equal(pistachio.checkForHealthy(), false);
assert.equal(mixedFruit.checkForHealthy(), true);
assert.equal(fruit.checkForHealthy(), true);
assert.equal(apple.checkForHealthy(), false);
// this is obviously a silly way to find healthy food IRL.
});
});