Skip to content

Commit f903358

Browse files
committed
Update mocks for adding shipping to a new order
1 parent 982e950 commit f903358

File tree

3 files changed

+131
-3
lines changed

3 files changed

+131
-3
lines changed

WooCommerce/WooCommerce.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,6 +1260,7 @@
12601260
CC254F3426C4113B005F3C82 /* ShippingLabelPackageSelection.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC254F3326C4113B005F3C82 /* ShippingLabelPackageSelection.swift */; };
12611261
CC254F3626C437AB005F3C82 /* ShippingLabelCustomPackageForm.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC254F3526C437AB005F3C82 /* ShippingLabelCustomPackageForm.swift */; };
12621262
CC254F3826C43B52005F3C82 /* ShippingLabelCustomPackageFormViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC254F3726C43B52005F3C82 /* ShippingLabelCustomPackageFormViewModel.swift */; };
1263+
CC2A08022862400100510C4B /* orders_3337_add_shipping.json in Resources */ = {isa = PBXBuildFile; fileRef = CC2A08012862400100510C4B /* orders_3337_add_shipping.json */; };
12631264
CC2E72F727B6BFB800A62872 /* ProductVariationFormatterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC2E72F627B6BFB800A62872 /* ProductVariationFormatterTests.swift */; };
12641265
CC440E1E2770C6AF0074C264 /* ProductInOrderViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC440E1D2770C6AF0074C264 /* ProductInOrderViewModel.swift */; };
12651266
CC4A4E962655273D00B75DCD /* ShippingLabelPaymentMethods.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC4A4E952655273D00B75DCD /* ShippingLabelPaymentMethods.swift */; };
@@ -3032,6 +3033,7 @@
30323033
CC254F3326C4113B005F3C82 /* ShippingLabelPackageSelection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShippingLabelPackageSelection.swift; sourceTree = "<group>"; };
30333034
CC254F3526C437AB005F3C82 /* ShippingLabelCustomPackageForm.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShippingLabelCustomPackageForm.swift; sourceTree = "<group>"; };
30343035
CC254F3726C43B52005F3C82 /* ShippingLabelCustomPackageFormViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShippingLabelCustomPackageFormViewModel.swift; sourceTree = "<group>"; };
3036+
CC2A08012862400100510C4B /* orders_3337_add_shipping.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = orders_3337_add_shipping.json; sourceTree = "<group>"; };
30353037
CC2E72F627B6BFB800A62872 /* ProductVariationFormatterTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductVariationFormatterTests.swift; sourceTree = "<group>"; };
30363038
CC440E1D2770C6AF0074C264 /* ProductInOrderViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductInOrderViewModel.swift; sourceTree = "<group>"; };
30373039
CC4A4E952655273D00B75DCD /* ShippingLabelPaymentMethods.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShippingLabelPaymentMethods.swift; sourceTree = "<group>"; };
@@ -6904,6 +6906,7 @@
69046906
CC5C278A27EE314E00B25D2A /* orders_3337_create_order.json */,
69056907
CCF27B33280EF69600B755E1 /* orders_3337_add_product.json */,
69066908
C0A37CB7282957EB00E0826D /* orders_3337_add_customer_details.json */,
6909+
CC2A08012862400100510C4B /* orders_3337_add_shipping.json */,
69076910
CCF27B39280EF98F00B755E1 /* orders_3337.json */,
69086911
800A5B9A2755E0B9009DE2CD /* orders_any.json */,
69096912
800A5B9F27562EE5009DE2CD /* orders_processing.json */,
@@ -8586,6 +8589,7 @@
85868589
800A5BB027586898009DE2CD /* products_2132.json in Resources */,
85878590
800A5BA6275719E5009DE2CD /* orders_2201_refunds.json in Resources */,
85888591
800A5BA827586126009DE2CD /* products_2129.json in Resources */,
8592+
CC2A08022862400100510C4B /* orders_3337_add_shipping.json in Resources */,
85898593
800A5BC027586AFC009DE2CD /* products_reviews_6164.json in Resources */,
85908594
800A5BC5275889ED009DE2CD /* reports_revenue_stats_day.json in Resources */,
85918595
800A5B972755BA02009DE2CD /* status.json in Resources */,

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

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
"date_modified": "{{now offset='-10 minutes' format=customformat}}",
2626
"discount_total": "0.00",
2727
"discount_tax": "0.00",
28-
"shipping_total": "0.00",
28+
"shipping_total": "1.25",
2929
"shipping_tax": "0.00",
3030
"cart_tax": "0.00",
31-
"total": "110.00",
31+
"total": "111.25",
3232
"total_tax": "0.00",
3333
"customer_id": 0,
3434
"order_key": "abc123",
@@ -86,7 +86,15 @@
8686
"price": 110
8787
}],
8888
"tax_lines": [],
89-
"shipping_lines": [],
89+
"shipping_lines": [{
90+
"id": 1,
91+
"method_title": "Flat Rate",
92+
"method_id": "other",
93+
"total": "1.25",
94+
"total_tax": "0.00",
95+
"taxes": [],
96+
"meta_data": []
97+
}],
9098
"fee_lines": [],
9199
"coupon_lines": [],
92100
"refunds": [],
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
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": "%22fee_lines%22%3A%5B%5D" },
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": "111.25",
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+
"coupon_lines": [],
99+
"refunds": [],
100+
"date_created_gmt": "{{#assign 'customformat'}}yyyy-MM-dd'T'HH:mm:ss{{/assign}}{{now format=customformat}}",
101+
"date_modified_gmt": "{{now offset='-10 minutes' format=customformat}}",
102+
"date_completed_gmt": null,
103+
"date_paid_gmt": null,
104+
"currency_symbol": "$",
105+
"_links": {
106+
"self": [{
107+
"href": ""
108+
}],
109+
"collection": [{
110+
"href": ""
111+
}]
112+
}
113+
}
114+
}
115+
}
116+
}

0 commit comments

Comments
 (0)