From 6d97fd88d20e4b8aaaf380851ae56bb228026c99 Mon Sep 17 00:00:00 2001 From: Paulo Iankoski Date: Tue, 30 Apr 2024 19:51:45 -0300 Subject: [PATCH] test: update tests with the new amount levels schema --- .../DonateFormRouteDataTest.php | 13 ++++++------- .../ValidationRouteDataTest.php | 12 ++++++------ .../StoreBackwardsCompatibleFormMetaTest.php | 18 ++++++++++++++++-- 3 files changed, 28 insertions(+), 15 deletions(-) diff --git a/tests/Unit/DataTransferObjects/DonateFormRouteDataTest.php b/tests/Unit/DataTransferObjects/DonateFormRouteDataTest.php index becf5d5f5a..c7466ef474 100644 --- a/tests/Unit/DataTransferObjects/DonateFormRouteDataTest.php +++ b/tests/Unit/DataTransferObjects/DonateFormRouteDataTest.php @@ -140,14 +140,13 @@ public function testValidatedShouldReturnValidatedDataWithSubscriptionData() "attributes": { "label": "Donation Amount", "levels": [ - "10", - "25", - "50", - "100", - "250", - "500" + {"value": "10"}, + {"value": "25"}, + {"value": "50"}, + {"value": "100", "checked": true}, + {"value": "250"}, + {"value": "500"} ], - "defaultLevel": "100", "priceOption": "multi", "setPrice": "100", "customAmount": "true", diff --git a/tests/Unit/DataTransferObjects/ValidationRouteDataTest.php b/tests/Unit/DataTransferObjects/ValidationRouteDataTest.php index c1102f3c70..84ebbf3a64 100644 --- a/tests/Unit/DataTransferObjects/ValidationRouteDataTest.php +++ b/tests/Unit/DataTransferObjects/ValidationRouteDataTest.php @@ -154,12 +154,12 @@ public function testValidateShouldReturnTrueWithRecurringOptions() "attributes": { "label": "Donation Amount", "levels": [ - "10", - "25", - "50", - "100", - "250", - "500" + {"value": "10"}, + {"value": "25"}, + {"value": "50"}, + {"value": "100"}, + {"value": "250"}, + {"value": "500"} ], "priceOption": "multi", "setPrice": "100", diff --git a/tests/Unit/DonationForms/Actions/StoreBackwardsCompatibleFormMetaTest.php b/tests/Unit/DonationForms/Actions/StoreBackwardsCompatibleFormMetaTest.php index 562de4aa64..3660eaa473 100644 --- a/tests/Unit/DonationForms/Actions/StoreBackwardsCompatibleFormMetaTest.php +++ b/tests/Unit/DonationForms/Actions/StoreBackwardsCompatibleFormMetaTest.php @@ -82,7 +82,14 @@ public function testRecurringMetaIsStoredOnUpdate() 'isValid' => true, 'attributes' => [ 'label' => 'Donation Amount', - 'levels' => ['10', '25', '50', '100', '250', '500'], + 'levels' => [ + ['value' => '10'], + ['value' => '25'], + ['value' => '50'], + ['value' => '100'], + ['value' => '250'], + ['value' => '500'], + ], 'priceOption' => 'multi', 'setPrice' => '25', 'customAmount' => 'true', @@ -131,7 +138,14 @@ public function testRecurringMetaIsStoredOnInsert() 'isValid' => true, 'attributes' => [ 'label' => 'Donation Amount', - 'levels' => ['10', '25', '50', '100', '250', '500'], + 'levels' => [ + ['value' => '10'], + ['value' => '25'], + ['value' => '50'], + ['value' => '100'], + ['value' => '250'], + ['value' => '500'], + ], 'priceOption' => 'multi', 'setPrice' => '25', 'customAmount' => 'true',