@@ -27,17 +27,17 @@ describe('state indicators service', function () {
27
27
var lgaStockCounts = [
28
28
{
29
29
location : { zone : 'nc' , state : 'kogi' , lga : 'a' } ,
30
- stock : { 'product:a' : 1 , 'product:b' : 3 , 'product:c' : 10 , 'product:d' : 36 } ,
30
+ stock : { 'product:a' : { amount : 1 } , 'product:b' : { amount : 3 } , 'product:c' : { amount : 10 } , 'product:d' : { amount : 36 } } ,
31
31
store : { type : 'lga' }
32
32
} ,
33
33
{
34
34
location : { zone : 'nc' , state : 'kogi' , lga : 'b' } ,
35
- stock : { 'product:a' : 0 , 'product:b' : 0 , 'product:c' : 11 , 'product:d' : 30 } ,
35
+ stock : { 'product:a' : { amount : 0 } , 'product:b' : { amount : 0 } , 'product:c' : { amount : 11 } , 'product:d' : { amount : 30 } } ,
36
36
store : { type : 'lga' }
37
37
} ,
38
38
{
39
39
location : { zone : 'nc' , state : 'kogi' , lga : 'c' } ,
40
- stock : { 'product:a' : 0 , 'product:b' : 0 , 'product:c' : 0 , 'product:d' : 75 } ,
40
+ stock : { 'product:a' : { amount : 0 } , 'product:b' : { amount : 0 } , 'product:c' : { amount : 0 } , 'product:d' : { amount : 75 } } ,
41
41
store : { type : 'lga' }
42
42
} ,
43
43
{
@@ -54,23 +54,23 @@ describe('state indicators service', function () {
54
54
var stateStockCounts = [
55
55
{
56
56
location : { zone : 'nc' , state : 'kogi' } ,
57
- stock : { 'product:a' : 0 , 'product:b' : 1 , 'product:c' : 10 , 'product:d' : 40 } ,
57
+ stock : { 'product:a' : { amount : 0 } , 'product:b' : { amount : 1 } , 'product:c' : { amount : 10 } , 'product:d' : { amount : 40 } } ,
58
58
store : { type : 'state' }
59
59
}
60
60
]
61
61
62
62
var zoneStockCounts = [
63
63
{
64
64
location : { zone : 'nc' } ,
65
- stock : { 'product:a' : 0 , 'product:b' : 11 , 'product:c' : 20 , 'product:d' : 40 } ,
65
+ stock : { 'product:a' : { amount : 0 } , 'product:b' : { amount : 11 } , 'product:c' : { amount : 20 } , 'product:d' : { amount : 40 } } ,
66
66
store : { type : 'zone' }
67
67
}
68
68
]
69
69
70
70
var nationalStockCounts = [
71
71
{
72
72
location : { national : 'national' } ,
73
- stock : { 'product:a' : 1 , 'product:b' : 3 , 'product:c' : 10 , 'product:d' : 36 } ,
73
+ stock : { 'product:a' : { amount : 1 } , 'product:b' : { amount : 3 } , 'product:c' : { amount : 10 } , 'product:d' : { amount : 36 } } ,
74
74
store : { type : 'national' }
75
75
}
76
76
]
@@ -435,7 +435,7 @@ describe('state indicators service', function () {
435
435
var noRestockStateStockCounts = [
436
436
{
437
437
location : { zone : 'nc' , state : 'kogi' } ,
438
- stock : { 'product:a' : 5 , 'product:b' : 10 , 'product:c' : 20 , 'product:d' : 30 } ,
438
+ stock : { 'product:a' : { amount : 5 } , 'product:b' : { amount : 10 } , 'product:c' : { amount : 20 } , 'product:d' : { amount : 30 } } ,
439
439
store : { type : 'state' }
440
440
}
441
441
]
@@ -482,7 +482,7 @@ describe('state indicators service', function () {
482
482
} )
483
483
var unknownLgaStockCount = {
484
484
location : { zone : 'nc' , state : 'kogi' , lga : 'unknown' } ,
485
- stock : { 'product:a' : 2 , 'product:b' : 3 , 'product:c' : 10 , 'product:d' : 20 } ,
485
+ stock : { 'product:a' : { amount : 2 } , 'product:b' : { amount : 3 } , 'product:c' : { amount : 10 } , 'product:d' : { amount : 20 } } ,
486
486
store : { type : 'lga' }
487
487
}
488
488
var expected = [
@@ -512,7 +512,7 @@ describe('state indicators service', function () {
512
512
it ( 'is true for lgas if any product is below reorder level' , function ( done ) {
513
513
var noRestockNeeded = {
514
514
location : { zone : 'nc' , state : 'kogi' , lga : 'b' } ,
515
- stock : { 'product:a' : 3 , 'product:b' : 3 , 'product:c' : 3 , 'product:d' : 3 } ,
515
+ stock : { 'product:a' : { amount : 3 } , 'product:b' : { amount : 3 } , 'product:c' : { amount : 3 } , 'product:d' : { amount : 3 } } ,
516
516
store : { type : 'lga' }
517
517
}
518
518
var stockCounts = [ angular . copy ( lgaStockCounts [ 0 ] ) , noRestockNeeded ]
@@ -527,12 +527,12 @@ describe('state indicators service', function () {
527
527
it ( 'is true for states if any product is below max level' , function ( done ) {
528
528
var reStockNeeded = {
529
529
location : { zone : 'nc' , state : 'kogi' } ,
530
- stock : { 'product:a' : 4 , 'product:b' : 9 , 'product:c' : 19 , 'product:d' : 29 } ,
530
+ stock : { 'product:a' : { amount : 4 } , 'product:b' : { amount : 9 } , 'product:c' : { amount : 19 } , 'product:d' : { amount : 29 } } ,
531
531
store : { type : 'state' }
532
532
}
533
533
var noRestockNeeded = {
534
534
location : { zone : 'nc' , state : 'kogi' } ,
535
- stock : { 'product:a' : 10 , 'product:b' : 10 , 'product:c' : 20 , 'product:d' : 30 } ,
535
+ stock : { 'product:a' : { amount : 10 } , 'product:b' : { amount : 10 } , 'product:c' : { amount : 20 } , 'product:d' : { amount : 30 } } ,
536
536
store : { type : 'state' }
537
537
}
538
538
var stockCounts = [ reStockNeeded , noRestockNeeded ]
@@ -547,12 +547,12 @@ describe('state indicators service', function () {
547
547
it ( 'is true for zones if any product is below max level' , function ( done ) {
548
548
var reStockNeeded = {
549
549
location : { zone : 'nc' } ,
550
- stock : { 'product:a' : 4 , 'product:b' : 9 , 'product:c' : 19 , 'product:d' : 29 } ,
550
+ stock : { 'product:a' : { amount : 4 } , 'product:b' : { amount : 9 } , 'product:c' : { amount : 19 } , 'product:d' : { amount : 29 } } ,
551
551
store : { type : 'zone' }
552
552
}
553
553
var noRestockNeeded = {
554
554
location : { zone : 'nc' } ,
555
- stock : { 'product:a' : 10 , 'product:b' : 10 , 'product:c' : 20 , 'product:d' : 30 } ,
555
+ stock : { 'product:a' : { amount : 10 } , 'product:b' : { amount : 10 } , 'product:c' : { amount : 20 } , 'product:d' : { amount : 30 } } ,
556
556
store : { type : 'zone' }
557
557
}
558
558
var stockCounts = [ reStockNeeded , noRestockNeeded ]
0 commit comments