Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/inikoo/aiku into main
Browse files Browse the repository at this point in the history
  • Loading branch information
itzArtha committed Oct 4, 2024
2 parents d8bf709 + deda0fe commit 4a32cf5
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/Feature/CrmTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Copyright (c) 2024, Raul A Perusquia Flores
*/

use App\Actions\CRM\Customer\AddDeliveryAddressToCustomer;
use App\Actions\CRM\Customer\HydrateCustomers;
use App\Actions\CRM\Customer\StoreCustomer;
use App\Actions\CRM\Prospect\StoreProspect;
Expand All @@ -16,6 +17,8 @@
use App\Enums\Mail\Outbox\OutboxTypeEnum;
use App\Models\CRM\Customer;
use App\Models\CRM\Prospect;
use App\Models\Helpers\Address;
use App\Models\Helpers\Country;
use App\Models\Helpers\Query;
use App\Models\Mail\Mailshot;
use App\Models\Mail\Outbox;
Expand Down Expand Up @@ -171,6 +174,26 @@
->and($outbox->stats->number_mailshots)->toBe(1);
});

test('add delivery address to customer', function (Customer $customer) {
$country = Country::latest()->first();
$customer = AddDeliveryAddressToCustomer::make()->action($customer,
[
'delivery_address' => [
'address_line_1' => fake()->streetAddress,
'address_line_2' => fake()->buildingNumber,
'sorting_code' => '',
'postal_code' => fake()->postcode,
'locality' => fake()->city,
'dependent_locality' => '',
'administrative_area' => fake('en_US')->state() ,
'country_id' => $country->id
]
]);

expect($customer)->toBeInstanceOf(Customer::class)
->and($customer->addresses->count())->toBe(2);
})->depends('create customer');

test('can show list of prospects lists', function () {
$shop = $this->shop;
$response = get(route('grp.org.shops.show.crm.prospects.lists.index', [$shop->slug]));
Expand Down

0 comments on commit 4a32cf5

Please sign in to comment.