| 12345678910111213141516171819202122232425262728293031323334353637 |
- <?php
-
- namespace Tests\Feature;
-
- use App\Models\User;
- use Illuminate\Foundation\Testing\RefreshDatabase;
- use Inertia\Testing\AssertableInertia as Assert;
- use Tests\TestCase;
-
- class HomePageTest extends TestCase
- {
- use RefreshDatabase;
-
- public function test_visitors_see_the_home_page_with_real_prices()
- {
- $this->get(route('home'))
- ->assertOk()
- ->assertInertia(fn (Assert $page) => $page
- ->component('home')
- ->where('trialDays', 14)
- ->where('storeDomain', config('storefront.domain'))
- ->where('plans.0.key', 'trial')
- ->where('plans.0.price', 0)
- ->where('plans.1.name', 'Starter')
- ->where('plans.1.price', 39)
- ->where('plans.2.stores', 3)
- ->has('plans', 4));
- }
-
- public function test_signed_in_merchants_see_it_too()
- {
- $this->actingAs(User::factory()->create())
- ->get(route('home'))
- ->assertOk()
- ->assertInertia(fn (Assert $page) => $page->component('home'));
- }
- }
|