Skip to content

Commit 561c6f1

Browse files
author
Sharma Elanthiriayan
committed
MockOrders
- Stop calculating mock tax lines.
1 parent a8cd4ad commit 561c6f1

File tree

1 file changed

+8
-32
lines changed

1 file changed

+8
-32
lines changed

WooCommerce/WooCommerceTests/Tools/MockOrders.swift

Lines changed: 8 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,8 @@ final class MockOrders {
4242
items: [OrderItem] = [],
4343
shippingLines: [ShippingLine] = sampleShippingLines(),
4444
refunds: [OrderRefundCondensed] = [],
45-
fees: [OrderFeeLine] = []) -> Order {
46-
let shippingTax = "0.00"
47-
let totalTax = "1.20"
48-
let tax = makeOrderTaxLine(totalShippingTax: shippingTax,
49-
totalTax: totalTax)
50-
45+
fees: [OrderFeeLine] = [],
46+
taxes: [OrderTaxLine] = []) -> Order {
5147
return Order(siteID: siteID,
5248
orderID: orderID,
5349
parentID: 0,
@@ -63,9 +59,9 @@ final class MockOrders {
6359
discountTotal: "30.00",
6460
discountTax: "1.20",
6561
shippingTotal: "0.00",
66-
shippingTax: shippingTax,
62+
shippingTax: "0.00",
6763
total: "31.20",
68-
totalTax: totalTax,
64+
totalTax: "1.20",
6965
paymentMethodID: "stripe",
7066
paymentMethodTitle: "Credit Card (Stripe)",
7167
items: items,
@@ -75,8 +71,7 @@ final class MockOrders {
7571
coupons: [],
7672
refunds: refunds,
7773
fees: fees,
78-
taxes: [tax]
79-
)
74+
taxes: taxes)
8075
}
8176

8277
func sampleOrder() -> Order {
@@ -96,11 +91,6 @@ final class MockOrders {
9691
}
9792

9893
func sampleOrderCreatedInCurrentYear() -> Order {
99-
let shippingTax = "0.00"
100-
let totalTax = "1.20"
101-
let tax = makeOrderTaxLine(totalShippingTax: shippingTax,
102-
totalTax: totalTax)
103-
10494
return Order(siteID: siteID,
10595
orderID: orderID,
10696
parentID: 0,
@@ -116,9 +106,9 @@ final class MockOrders {
116106
discountTotal: "30.00",
117107
discountTax: "1.20",
118108
shippingTotal: "0.00",
119-
shippingTax: shippingTax,
109+
shippingTax: "0.00",
120110
total: "31.20",
121-
totalTax: totalTax,
111+
totalTax: "1.20",
122112
paymentMethodID: "stripe",
123113
paymentMethodTitle: "Credit Card (Stripe)",
124114
items: [],
@@ -128,8 +118,7 @@ final class MockOrders {
128118
coupons: [],
129119
refunds: [],
130120
fees: [],
131-
taxes: [tax]
132-
)
121+
taxes: [])
133122
}
134123

135124
static func sampleShippingLines(cost: String = "133.00", tax: String = "0.00") -> [ShippingLine] {
@@ -141,19 +130,6 @@ final class MockOrders {
141130
taxes: [])]
142131
}
143132

144-
func makeOrderTaxLine(totalShippingTax: String,
145-
totalTax: String) -> OrderTaxLine {
146-
.init(taxID: 123,
147-
rateCode: "",
148-
rateID: 1,
149-
label: "State",
150-
isCompoundTaxRate: false,
151-
totalTax: totalTax,
152-
totalShippingTax: totalShippingTax,
153-
ratePercent: 5.5,
154-
attributes: [])
155-
}
156-
157133
func sampleFeeLines() -> [OrderFeeLine] {
158134
return [
159135
sampleFeeLine()

0 commit comments

Comments
 (0)