UPDATED TESTS wirr dusk
This commit is contained in:
@@ -2,47 +2,37 @@
|
||||
|
||||
namespace Tests\Browser;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||
use Laravel\Dusk\Browser;
|
||||
use Modules\Platform\app\Models\PlatformPrice;
|
||||
use Tests\Browser\Concerns\InteractsWithWmsBrowser;
|
||||
use Tests\Browser\Concerns\InteractsWithWmsData;
|
||||
use Tests\DuskTestCase;
|
||||
|
||||
class WmsPricingCrudBrowserTest extends DuskTestCase
|
||||
{
|
||||
use DatabaseMigrations;
|
||||
/**
|
||||
* Ensure pricing cards remain visible on the Platform page and CRUD remains under Administration.
|
||||
*/
|
||||
use InteractsWithWmsBrowser;
|
||||
use InteractsWithWmsData;
|
||||
|
||||
public function test_platform_pricing_cards_and_admin_price_crud_are_reachable(): void
|
||||
{
|
||||
$admin = User::factory()->mpbaPlatformAdmin()->create();
|
||||
PlatformPrice::create([
|
||||
'code' => 'basic',
|
||||
'name' => 'Basic',
|
||||
'strapline' => 'Starter plan',
|
||||
'description' => 'Entry WMS access.',
|
||||
'monthly_amount' => 4900,
|
||||
'annual_amount' => 49000,
|
||||
'currency' => 'gbp',
|
||||
'badge_label' => 'Starter',
|
||||
'features' => ['2 warehouses', '10 users'],
|
||||
'sort_order' => 10,
|
||||
'is_featured' => false,
|
||||
'is_active' => true,
|
||||
]);
|
||||
$admin = $this->platformAdminUser();
|
||||
$this->seedPlatformPrices();
|
||||
|
||||
$this->browse(function (Browser $browser) use ($admin): void {
|
||||
$browser->loginAs($admin)
|
||||
->resize(1440, 1000)
|
||||
->visitRoute('platform.dashboard')
|
||||
->assertSee('Pricing plans')
|
||||
->assertSee('Basic')
|
||||
->clickLink('Manage prices')
|
||||
->assertRouteIs('platform.prices.index')
|
||||
->assertSee('Pricing Administration')
|
||||
->clickLink('Add price')
|
||||
->assertRouteIs('platform.prices.create')
|
||||
->visit('/platform/pricing');
|
||||
|
||||
$this->assertSingleProfessionalHeader($browser, 'Pricing');
|
||||
$browser->assertSee('Basic')
|
||||
->assertSee('Advanced')
|
||||
->assertSee('Pro')
|
||||
->visit('/admin/prices');
|
||||
|
||||
$this->assertSingleProfessionalHeader($browser, 'Platform Prices');
|
||||
$browser->assertSee('Basic')
|
||||
->assertSee('Advanced')
|
||||
->assertSee('Pro')
|
||||
->assertSee('Create Price');
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user