diff --git a/packages/Webkul/Shop/tests/Feature/Checkout/CheckoutTest.php b/packages/Webkul/Shop/tests/Feature/Checkout/CheckoutTest.php index d313beb304b..6073aa705d1 100644 --- a/packages/Webkul/Shop/tests/Feature/Checkout/CheckoutTest.php +++ b/packages/Webkul/Shop/tests/Feature/Checkout/CheckoutTest.php @@ -456,10 +456,6 @@ ], ]) ->assertOk() - ->assertJsonPath('data.payment_methods.0.method', 'paypal_smart_button') - ->assertJsonPath('data.payment_methods.0.method_title', 'PayPal Smart Button') - ->assertJsonPath('data.payment_methods.0.description', 'PayPal') - ->assertJsonPath('data.payment_methods.0.sort', 0) ->assertJsonPath('data.payment_methods.1.method', 'moneytransfer') ->assertJsonPath('data.payment_methods.1.method_title', 'Money Transfer') ->assertJsonPath('data.payment_methods.1.description', 'Money Transfer') @@ -468,6 +464,10 @@ ->assertJsonPath('data.payment_methods.2.method_title', 'PayPal Standard') ->assertJsonPath('data.payment_methods.2.description', 'PayPal Standard') ->assertJsonPath('data.payment_methods.2.sort', 3) + ->assertJsonPath('data.payment_methods.0.method', 'paypal_smart_button') + ->assertJsonPath('data.payment_methods.0.method_title', 'PayPal Smart Button') + ->assertJsonPath('data.payment_methods.0.description', 'PayPal') + ->assertJsonPath('data.payment_methods.0.sort', 4) ->assertJsonPath('redirect', false); $this->assertModelWise([ @@ -784,10 +784,6 @@ ], ]) ->assertOk() - ->assertJsonPath('data.payment_methods.0.method', 'paypal_smart_button') - ->assertJsonPath('data.payment_methods.0.method_title', 'PayPal Smart Button') - ->assertJsonPath('data.payment_methods.0.description', 'PayPal') - ->assertJsonPath('data.payment_methods.0.sort', 0) ->assertJsonPath('data.payment_methods.1.method', 'moneytransfer') ->assertJsonPath('data.payment_methods.1.method_title', 'Money Transfer') ->assertJsonPath('data.payment_methods.1.description', 'Money Transfer') @@ -796,6 +792,10 @@ ->assertJsonPath('data.payment_methods.2.method_title', 'PayPal Standard') ->assertJsonPath('data.payment_methods.2.description', 'PayPal Standard') ->assertJsonPath('data.payment_methods.2.sort', 3) + ->assertJsonPath('data.payment_methods.0.method', 'paypal_smart_button') + ->assertJsonPath('data.payment_methods.0.method_title', 'PayPal Smart Button') + ->assertJsonPath('data.payment_methods.0.description', 'PayPal') + ->assertJsonPath('data.payment_methods.0.sort', 4) ->assertJsonPath('redirect', false); $this->assertModelWise([ @@ -1170,10 +1170,6 @@ 'shipping_method' => 'free_free', ]) ->assertOk() - ->assertJsonPath('payment_methods.0.method', 'paypal_smart_button') - ->assertJsonPath('payment_methods.0.method_title', 'PayPal Smart Button') - ->assertJsonPath('payment_methods.0.description', 'PayPal') - ->assertJsonPath('payment_methods.0.sort', 0) ->assertJsonPath('payment_methods.1.method', 'cashondelivery') ->assertJsonPath('payment_methods.1.method_title', 'Cash On Delivery') ->assertJsonPath('payment_methods.1.description', 'Cash On Delivery') @@ -1185,7 +1181,11 @@ ->assertJsonPath('payment_methods.3.method', 'paypal_standard') ->assertJsonPath('payment_methods.3.method_title', 'PayPal Standard') ->assertJsonPath('payment_methods.3.description', 'PayPal Standard') - ->assertJsonPath('payment_methods.3.sort', 3); + ->assertJsonPath('payment_methods.3.sort', 3) + ->assertJsonPath('payment_methods.0.method', 'paypal_smart_button') + ->assertJsonPath('payment_methods.0.method_title', 'PayPal Smart Button') + ->assertJsonPath('payment_methods.0.description', 'PayPal') + ->assertJsonPath('payment_methods.0.sort', 4); }); it('should store the shipping method for customer', function () { @@ -1260,10 +1260,6 @@ 'shipping_method' => 'free_free', ]) ->assertOk() - ->assertJsonPath('payment_methods.0.method', 'paypal_smart_button') - ->assertJsonPath('payment_methods.0.method_title', 'PayPal Smart Button') - ->assertJsonPath('payment_methods.0.description', 'PayPal') - ->assertJsonPath('payment_methods.0.sort', 0) ->assertJsonPath('payment_methods.1.method', 'cashondelivery') ->assertJsonPath('payment_methods.1.method_title', 'Cash On Delivery') ->assertJsonPath('payment_methods.1.description', 'Cash On Delivery') @@ -1275,7 +1271,11 @@ ->assertJsonPath('payment_methods.3.method', 'paypal_standard') ->assertJsonPath('payment_methods.3.method_title', 'PayPal Standard') ->assertJsonPath('payment_methods.3.description', 'PayPal Standard') - ->assertJsonPath('payment_methods.3.sort', 3); + ->assertJsonPath('payment_methods.3.sort', 3) + ->assertJsonPath('payment_methods.0.method', 'paypal_smart_button') + ->assertJsonPath('payment_methods.0.method_title', 'PayPal Smart Button') + ->assertJsonPath('payment_methods.0.description', 'PayPal') + ->assertJsonPath('payment_methods.0.sort', 4); }); it('should fails the validation error when store the payment method for guest user', function () {