@@ -2,7 +2,6 @@ import { describe, expect, it } from 'vitest';
22import {
33 calculateMonthlyTotal ,
44 convertCurrency ,
5- EXCHANGE_RATES_TO_KRW ,
65 formatPrice ,
76 normalizeToMonthly ,
87 type SubscriptionForCalculation ,
@@ -86,7 +85,12 @@ describe('calculateMonthlyTotal', () => {
8685
8786 it ( 'calculates total for single currency subscriptions' , ( ) => {
8887 const subscriptions : SubscriptionForCalculation [ ] = [
89- { price : 10000 , currency : 'KRW' , billingCycle : 'monthly' , isActive : true } ,
88+ {
89+ price : 10000 ,
90+ currency : 'KRW' ,
91+ billingCycle : 'monthly' ,
92+ isActive : true ,
93+ } ,
9094 { price : 5000 , currency : 'KRW' , billingCycle : 'monthly' , isActive : true } ,
9195 ] ;
9296 const result = calculateMonthlyTotal ( subscriptions , 'KRW' ) ;
@@ -96,7 +100,12 @@ describe('calculateMonthlyTotal', () => {
96100
97101 it ( 'excludes inactive subscriptions' , ( ) => {
98102 const subscriptions : SubscriptionForCalculation [ ] = [
99- { price : 10000 , currency : 'KRW' , billingCycle : 'monthly' , isActive : true } ,
103+ {
104+ price : 10000 ,
105+ currency : 'KRW' ,
106+ billingCycle : 'monthly' ,
107+ isActive : true ,
108+ } ,
100109 {
101110 price : 5000 ,
102111 currency : 'KRW' ,
@@ -110,7 +119,12 @@ describe('calculateMonthlyTotal', () => {
110119
111120 it ( 'detects mixed currencies' , ( ) => {
112121 const subscriptions : SubscriptionForCalculation [ ] = [
113- { price : 10000 , currency : 'KRW' , billingCycle : 'monthly' , isActive : true } ,
122+ {
123+ price : 10000 ,
124+ currency : 'KRW' ,
125+ billingCycle : 'monthly' ,
126+ isActive : true ,
127+ } ,
114128 { price : 10 , currency : 'USD' , billingCycle : 'monthly' , isActive : true } ,
115129 ] ;
116130 const result = calculateMonthlyTotal ( subscriptions , 'KRW' ) ;
@@ -119,7 +133,12 @@ describe('calculateMonthlyTotal', () => {
119133
120134 it ( 'converts and sums mixed currency subscriptions to KRW' , ( ) => {
121135 const subscriptions : SubscriptionForCalculation [ ] = [
122- { price : 10000 , currency : 'KRW' , billingCycle : 'monthly' , isActive : true } ,
136+ {
137+ price : 10000 ,
138+ currency : 'KRW' ,
139+ billingCycle : 'monthly' ,
140+ isActive : true ,
141+ } ,
123142 { price : 10 , currency : 'USD' , billingCycle : 'monthly' , isActive : true } ,
124143 ] ;
125144 // ₩10,000 + $10 (= ₩14,000) = ₩24,000
@@ -129,7 +148,12 @@ describe('calculateMonthlyTotal', () => {
129148
130149 it ( 'converts and sums mixed currency subscriptions to USD' , ( ) => {
131150 const subscriptions : SubscriptionForCalculation [ ] = [
132- { price : 14000 , currency : 'KRW' , billingCycle : 'monthly' , isActive : true } ,
151+ {
152+ price : 14000 ,
153+ currency : 'KRW' ,
154+ billingCycle : 'monthly' ,
155+ isActive : true ,
156+ } ,
133157 { price : 10 , currency : 'USD' , billingCycle : 'monthly' , isActive : true } ,
134158 ] ;
135159 // ₩14,000 (= $10) + $10 = $20
@@ -148,7 +172,12 @@ describe('calculateMonthlyTotal', () => {
148172
149173 it ( 'handles complex scenario with mixed currencies and billing cycles' , ( ) => {
150174 const subscriptions : SubscriptionForCalculation [ ] = [
151- { price : 10000 , currency : 'KRW' , billingCycle : 'monthly' , isActive : true } ,
175+ {
176+ price : 10000 ,
177+ currency : 'KRW' ,
178+ billingCycle : 'monthly' ,
179+ isActive : true ,
180+ } ,
152181 { price : 120 , currency : 'USD' , billingCycle : 'yearly' , isActive : true } ,
153182 { price : 30 , currency : 'EUR' , billingCycle : 'quarterly' , isActive : true } ,
154183 { price : 500 , currency : 'JPY' , billingCycle : 'weekly' , isActive : false } ,
0 commit comments