1
+ import { describe , expect , it } from "vitest" ;
1
2
import { calculateAmounts } from "~/tasks/MockDataManager/calculateAmounts" ;
2
3
3
4
describe ( "calculateAmounts" , ( ) => {
4
- it . skip ( "should properly calculate the amount of tasks and records - 50" , async ( ) => {
5
+ it ( "should properly calculate the amount of tasks and records - 50" , async ( ) => {
5
6
const values = calculateAmounts ( 50 ) ;
6
7
7
8
expect ( values ) . toEqual ( {
8
9
amountOfTasks : 1 ,
9
10
amountOfRecords : 50
10
11
} ) ;
11
12
} ) ;
12
- it . skip ( "should properly calculate the amount of tasks and records - 100" , async ( ) => {
13
- const values = calculateAmounts ( 100 ) ;
14
13
15
- expect ( values ) . toEqual ( {
16
- amountOfTasks : 1 ,
17
- amountOfRecords : 100
18
- } ) ;
19
- } ) ;
20
- it . skip ( "should properly calculate the amount of tasks and records - 249" , async ( ) => {
21
- const values = calculateAmounts ( 249 ) ;
22
-
23
- expect ( values ) . toEqual ( {
24
- amountOfTasks : 1 ,
25
- amountOfRecords : 249
26
- } ) ;
27
- } ) ;
28
- it . skip ( "should properly calculate the amount of tasks and records - 251" , async ( ) => {
29
- const values = calculateAmounts ( 251 ) ;
30
-
31
- expect ( values ) . toEqual ( {
32
- amountOfTasks : 1 ,
33
- amountOfRecords : 251
34
- } ) ;
35
- } ) ;
14
+
36
15
37
- it . skip ( "should properly calculate the amount of tasks and records - 500" , async ( ) => {
38
- const values = calculateAmounts ( 500 ) ;
39
-
40
- expect ( values ) . toEqual ( {
41
- amountOfTasks : 1 ,
42
- amountOfRecords : 500
43
- } ) ;
44
- } ) ;
45
-
46
- it . skip ( "should properly calculate the amount of tasks and records - 999" , async ( ) => {
47
- const values = calculateAmounts ( 999 ) ;
48
-
49
- expect ( values ) . toEqual ( {
50
- amountOfTasks : 1 ,
51
- amountOfRecords : 999
52
- } ) ;
53
- } ) ;
54
-
55
- it . skip ( "should properly calculate the amount of tasks and records - 9999" , async ( ) => {
16
+ it ( "should properly calculate the amount of tasks and records - 9999" , async ( ) => {
56
17
const values = calculateAmounts ( 9999 ) ;
57
18
58
19
expect ( values ) . toEqual ( {
@@ -61,7 +22,7 @@ describe("calculateAmounts", () => {
61
22
} ) ;
62
23
} ) ;
63
24
64
- it . skip ( "should properly calculate the amount of tasks and records - 10001" , async ( ) => {
25
+ it ( "should properly calculate the amount of tasks and records - 10001" , async ( ) => {
65
26
const values = calculateAmounts ( 10001 ) ;
66
27
67
28
expect ( values ) . toEqual ( {
@@ -70,86 +31,31 @@ describe("calculateAmounts", () => {
70
31
} ) ;
71
32
} ) ;
72
33
73
- it . skip ( "should properly calculate the amount of tasks and records - 25001" , async ( ) => {
34
+ it ( "should properly calculate the amount of tasks and records - 25001" , async ( ) => {
74
35
const values = calculateAmounts ( 25001 ) ;
75
36
76
37
expect ( values ) . toEqual ( {
77
38
amountOfTasks : 5 ,
78
39
amountOfRecords : 5000
79
40
} ) ;
80
41
} ) ;
81
-
82
- it . skip ( "should properly calculate the amount of tasks and records - 250000 " , async ( ) => {
83
- const values = calculateAmounts ( 250000 ) ;
84
-
42
+
43
+ it ( "should properly calculate the amount of tasks and records - 99999 " , async ( ) => {
44
+ const values = calculateAmounts ( 99999 ) ;
45
+
85
46
expect ( values ) . toEqual ( {
86
- amountOfTasks : 10 ,
87
- amountOfRecords : 25000
88
- } ) ;
89
- } ) ;
90
-
91
- it . skip ( "should properly calculate the amount of tasks and records - 990000" , async ( ) => {
92
- const values = calculateAmounts ( 990000 ) ;
93
-
94
- expect ( values ) . toEqual ( {
95
- amountOfTasks : 50 ,
96
- amountOfRecords : 19800
97
- } ) ;
98
- } ) ;
99
-
100
- it . skip ( "should properly calculate the amount of tasks and records - 2900000" , async ( ) => {
101
- const values = calculateAmounts ( 2900000 ) ;
102
-
103
- expect ( values ) . toEqual ( {
104
- amountOfTasks : 100 ,
105
- amountOfRecords : 29000
106
- } ) ;
107
- } ) ;
108
-
109
- it . skip ( "should properly calculate the amount of tasks and records - 3100000" , async ( ) => {
110
- const values = calculateAmounts ( 3100000 ) ;
111
-
112
- expect ( values ) . toEqual ( {
113
- amountOfTasks : 100 ,
114
- amountOfRecords : 31000
115
- } ) ;
116
- } ) ;
117
-
118
- it . skip ( "should properly calculate the amount of tasks and records - 5100000" , async ( ) => {
119
- const values = calculateAmounts ( 5100000 ) ;
120
-
121
- expect ( values ) . toEqual ( {
122
- amountOfTasks : 200 ,
123
- amountOfRecords : 25500
124
- } ) ;
125
- } ) ;
126
-
127
- it . skip ( "should properly calculate the amount of tasks and records - 10000000" , async ( ) => {
128
- const values = calculateAmounts ( 10000000 ) ;
129
-
130
- expect ( values ) . toEqual ( {
131
- amountOfTasks : 200 ,
132
- amountOfRecords : 50000
47
+ amountOfTasks : 5 ,
48
+ amountOfRecords : 20000
133
49
} ) ;
134
50
} ) ;
135
51
136
- it . skip ( "should properly calculate the amount of tasks and records - 10000001" , async ( ) => {
137
- expect . assertions ( 1 ) ;
138
-
139
- try {
140
- calculateAmounts ( 10000001 ) ;
141
- } catch ( ex ) {
142
- expect ( ex . message ) . toBe ( `No valid value found - input value is too large: 10000001.` ) ;
143
- }
144
- } ) ;
145
-
146
- it . skip ( "should properly calculate the amount of tasks and records - 50000000" , async ( ) => {
52
+ it ( "should fail to calculate because value is too large - 100001" , async ( ) => {
147
53
expect . assertions ( 1 ) ;
148
54
149
55
try {
150
- calculateAmounts ( 50000000 ) ;
56
+ calculateAmounts ( 100001 ) ;
151
57
} catch ( ex ) {
152
- expect ( ex . message ) . toBe ( `No valid value found - input value is too large: 50000000 .` ) ;
58
+ expect ( ex . message ) . toBe ( `No valid value found - input value is too large: 100001 .` ) ;
153
59
}
154
60
} ) ;
155
61
} ) ;
0 commit comments