Skip to content

Commit 261aaf6

Browse files
committed
Update mocks for adding fee to a new order
1 parent 353998e commit 261aaf6

File tree

3 files changed

+142
-2
lines changed

3 files changed

+142
-2
lines changed

WooCommerce/WooCommerce.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,6 +1262,7 @@
12621262
CC254F3826C43B52005F3C82 /* ShippingLabelCustomPackageFormViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC254F3726C43B52005F3C82 /* ShippingLabelCustomPackageFormViewModel.swift */; };
12631263
CC2A08022862400100510C4B /* orders_3337_add_shipping.json in Resources */ = {isa = PBXBuildFile; fileRef = CC2A08012862400100510C4B /* orders_3337_add_shipping.json */; };
12641264
CC2A08042863206000510C4B /* AddFeeScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC2A08032863206000510C4B /* AddFeeScreen.swift */; };
1265+
CC2A08062863222500510C4B /* orders_3337_add_fee.json in Resources */ = {isa = PBXBuildFile; fileRef = CC2A08052863222500510C4B /* orders_3337_add_fee.json */; };
12651266
CC2E72F727B6BFB800A62872 /* ProductVariationFormatterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC2E72F627B6BFB800A62872 /* ProductVariationFormatterTests.swift */; };
12661267
CC440E1E2770C6AF0074C264 /* ProductInOrderViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC440E1D2770C6AF0074C264 /* ProductInOrderViewModel.swift */; };
12671268
CC4A4E962655273D00B75DCD /* ShippingLabelPaymentMethods.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC4A4E952655273D00B75DCD /* ShippingLabelPaymentMethods.swift */; };
@@ -3036,6 +3037,7 @@
30363037
CC254F3726C43B52005F3C82 /* ShippingLabelCustomPackageFormViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShippingLabelCustomPackageFormViewModel.swift; sourceTree = "<group>"; };
30373038
CC2A08012862400100510C4B /* orders_3337_add_shipping.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = orders_3337_add_shipping.json; sourceTree = "<group>"; };
30383039
CC2A08032863206000510C4B /* AddFeeScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddFeeScreen.swift; sourceTree = "<group>"; };
3040+
CC2A08052863222500510C4B /* orders_3337_add_fee.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = orders_3337_add_fee.json; sourceTree = "<group>"; };
30393041
CC2E72F627B6BFB800A62872 /* ProductVariationFormatterTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductVariationFormatterTests.swift; sourceTree = "<group>"; };
30403042
CC440E1D2770C6AF0074C264 /* ProductInOrderViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductInOrderViewModel.swift; sourceTree = "<group>"; };
30413043
CC4A4E952655273D00B75DCD /* ShippingLabelPaymentMethods.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShippingLabelPaymentMethods.swift; sourceTree = "<group>"; };
@@ -6909,6 +6911,7 @@
69096911
CCF27B33280EF69600B755E1 /* orders_3337_add_product.json */,
69106912
C0A37CB7282957EB00E0826D /* orders_3337_add_customer_details.json */,
69116913
CC2A08012862400100510C4B /* orders_3337_add_shipping.json */,
6914+
CC2A08052863222500510C4B /* orders_3337_add_fee.json */,
69126915
CCF27B39280EF98F00B755E1 /* orders_3337.json */,
69136916
800A5B9A2755E0B9009DE2CD /* orders_any.json */,
69146917
800A5B9F27562EE5009DE2CD /* orders_processing.json */,
@@ -8597,6 +8600,7 @@
85978600
800A5BC5275889ED009DE2CD /* reports_revenue_stats_day.json in Resources */,
85988601
800A5B972755BA02009DE2CD /* status.json in Resources */,
85998602
800A5BC8275889ED009DE2CD /* reports_revenue_stats_year.json in Resources */,
8603+
CC2A08062863222500510C4B /* orders_3337_add_fee.json in Resources */,
86008604
800A5BBC27586AE1009DE2CD /* products_reviews_6162.json in Resources */,
86018605
800A5B6127548F53009DE2CD /* sites_posts_password.json in Resources */,
86028606
800A5BB427586A0E009DE2CD /* products_reviews_6155.json in Resources */,

WooCommerce/WooCommerceUITests/Mocks/mappings/jetpack-blogs/wc/orders/orders_3337.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"shipping_total": "1.25",
2929
"shipping_tax": "0.00",
3030
"cart_tax": "0.00",
31-
"total": "111.25",
31+
"total": "113.59",
3232
"total_tax": "0.00",
3333
"customer_id": 0,
3434
"order_key": "abc123",
@@ -95,7 +95,17 @@
9595
"taxes": [],
9696
"meta_data": []
9797
}],
98-
"fee_lines": [],
98+
"fee_lines": [{
99+
"id": 1,
100+
"name": "Fee",
101+
"tax_class": "",
102+
"tax_status": "taxable",
103+
"amount": "2.34",
104+
"total": "2.34",
105+
"total_tax": "0.00",
106+
"taxes": [],
107+
"meta_data": []
108+
}],
99109
"coupon_lines": [],
100110
"refunds": [],
101111
"date_created_gmt": "{{#assign 'customformat'}}yyyy-MM-dd'T'HH:mm:ss{{/assign}}{{now format=customformat}}",
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
{
2+
"request": {
3+
"method": "POST",
4+
"urlPath": "/rest/v1.1/jetpack-blogs/161477129/rest-api/",
5+
"bodyPatterns": [
6+
{ "matches": ".*path=/wc/v3/orders/3337%26_method%3Dpost.*" },
7+
{ "contains": "%22product_id%22%3A2129" },
8+
{ "contains": "%22name%22%3A%22Fee%22" },
9+
{ "contains": "%22method_title%22%3A%22Flat%20Rate%22" },
10+
{ "contains": "%22first_name%22%3A%22Mira%22" }
11+
]
12+
},
13+
"response": {
14+
"status": 200,
15+
"jsonBody": {
16+
"data": {
17+
"id": 3337,
18+
"parent_id": 0,
19+
"status": "auto-draft",
20+
"currency": "USD",
21+
"version": "6.3.1",
22+
"prices_include_tax": true,
23+
"date_created": "{{#assign 'customformat'}}yyyy-MM-dd'T'HH:mm:ss{{/assign}}{{now format=customformat}}",
24+
"date_modified": "{{now offset='-10 minutes' format=customformat}}",
25+
"discount_total": "0.00",
26+
"discount_tax": "0.00",
27+
"shipping_total": "1.25",
28+
"shipping_tax": "0.00",
29+
"cart_tax": "0.00",
30+
"total": "113.59",
31+
"total_tax": "0.00",
32+
"customer_id": 0,
33+
"order_key": "abc123",
34+
"billing": {
35+
"first_name": "Mira",
36+
"last_name": "",
37+
"company": "",
38+
"address_1": "",
39+
"address_2": "",
40+
"city": "",
41+
"state": "",
42+
"postcode": "",
43+
"country": "",
44+
"email": "",
45+
"phone": ""
46+
},
47+
"shipping": {
48+
"first_name": "",
49+
"last_name": "",
50+
"company": "",
51+
"address_1": "",
52+
"address_2": "",
53+
"city": "",
54+
"state": "",
55+
"postcode": "",
56+
"country": "",
57+
"phone": ""
58+
},
59+
"payment_method": "",
60+
"payment_method_title": "",
61+
"transaction_id": "",
62+
"customer_ip_address": "",
63+
"customer_user_agent": "",
64+
"created_via": "rest-api",
65+
"customer_note": "",
66+
"date_completed": null,
67+
"date_paid": null,
68+
"cart_hash": "",
69+
"number": "3337",
70+
"meta_data": [],
71+
"line_items": [{
72+
"id": 1,
73+
"name": "Akoya Pearl shades",
74+
"product_id": 2129,
75+
"variation_id": 0,
76+
"quantity": 1,
77+
"tax_class": "",
78+
"subtotal": "110.00",
79+
"subtotal_tax": "0.00",
80+
"total": "110.00",
81+
"total_tax": "0.00",
82+
"taxes": [],
83+
"meta_data": [],
84+
"sku": "",
85+
"price": 110
86+
}],
87+
"tax_lines": [],
88+
"shipping_lines": [{
89+
"id": 1,
90+
"method_title": "Flat Rate",
91+
"method_id": "other",
92+
"total": "1.25",
93+
"total_tax": "0.00",
94+
"taxes": [],
95+
"meta_data": []
96+
}],
97+
"fee_lines": [{
98+
"id": 1,
99+
"name": "Fee",
100+
"tax_class": "",
101+
"tax_status": "taxable",
102+
"amount": "2.34",
103+
"total": "2.34",
104+
"total_tax": "0.00",
105+
"taxes": [],
106+
"meta_data": []
107+
}],
108+
"coupon_lines": [],
109+
"refunds": [],
110+
"date_created_gmt": "{{#assign 'customformat'}}yyyy-MM-dd'T'HH:mm:ss{{/assign}}{{now format=customformat}}",
111+
"date_modified_gmt": "{{now offset='-10 minutes' format=customformat}}",
112+
"date_completed_gmt": null,
113+
"date_paid_gmt": null,
114+
"currency_symbol": "$",
115+
"_links": {
116+
"self": [{
117+
"href": ""
118+
}],
119+
"collection": [{
120+
"href": ""
121+
}]
122+
}
123+
}
124+
}
125+
}
126+
}

0 commit comments

Comments
 (0)