File tree Expand file tree Collapse file tree 1 file changed +4
-13
lines changed
src/packages/util/licenses/purchase Expand file tree Collapse file tree 1 file changed +4
-13
lines changed Original file line number Diff line number Diff line change @@ -35,12 +35,13 @@ describe("compute-cost v1 pricing", () => {
35
35
) ;
36
36
} ) ;
37
37
38
- it ( "computes correct cost when version not given (since version 1 is the default )" , ( ) => {
38
+ it ( "computes cost throws error when version not given (defaults are DANGEROUS AND CONFUSING )" , ( ) => {
39
39
const info = { ...info1 } ;
40
40
// @ts -ignore
41
41
delete info [ "version" ] ;
42
- const cost = compute_cost ( info ) ;
43
- expect ( decimalMultiply ( cost . cost_sub_month , cost . quantity ) ) . toBe ( monthly1 ) ;
42
+ expect ( ( ) => {
43
+ compute_cost ( info ) ;
44
+ } ) . toThrow ( ) ;
44
45
} ) ;
45
46
46
47
it ( "computes correct cost with a different version of pricing params" , ( ) => {
@@ -137,16 +138,6 @@ describe("compute-cost v3 pricing", () => {
137
138
) ;
138
139
} ) ;
139
140
140
- it ( "version 1 is the default" , ( ) => {
141
- const info = { ...info1 } ;
142
- // @ts -ignore
143
- delete info [ "version" ] ;
144
- const cost = compute_cost ( info ) ;
145
- expect ( decimalMultiply ( cost . cost_sub_month , cost . quantity ) ) . toBe (
146
- MONTHLY_V1 ,
147
- ) ;
148
- } ) ;
149
-
150
141
it ( "computes correct cost with a different version of pricing params" , ( ) => {
151
142
const info = { ...info1 } ;
152
143
// @ts -ignore
You can’t perform that action at this time.
0 commit comments