dishplanner/tests/Browser/Dishes/CreateDishTest.php

48 lines
1.3 KiB
PHP
Raw Permalink Normal View History

<?php
namespace Tests\Browser\Dishes;
use Laravel\Dusk\Browser;
use Tests\Browser\LoginHelpers;
2026-08-17 13:30:49 +02:00
use Tests\Browser\Pages\DishesPage;
use Tests\DuskTestCase;
class CreateDishTest extends DuskTestCase
{
use LoginHelpers;
2026-08-17 13:30:49 +02:00
protected static $createDishTestPlanner = null;
2026-08-17 13:30:49 +02:00
protected static $createDishTestEmail = null;
2026-08-17 13:30:49 +02:00
protected function setUp(): void
{
parent::setUp();
// Reset static planner for this specific test class
self::$testPlanner = self::$createDishTestPlanner;
self::$testEmail = self::$createDishTestEmail;
}
2026-08-17 13:30:49 +02:00
protected function tearDown(): void
{
// Save the planner for next test method in this class
self::$createDishTestPlanner = self::$testPlanner;
self::$createDishTestEmail = self::$testEmail;
parent::tearDown();
}
2026-08-17 13:30:49 +02:00
public function test_can_access_dishes_page(): void
{
$this->browse(function (Browser $browser) {
$this->loginAndGoToDishes($browser);
2026-08-17 13:30:49 +02:00
$browser->on(new DishesPage)
2026-08-17 13:30:49 +02:00
->assertSee('MANAGE DISHES')
->assertSee('Add Dish');
});
}
// TODO: Moved to separate single-method test files to avoid static planner issues
// See: OpenCreateDishModalTest, CreateDishFormValidationTest, CancelDishCreationTest, CreateDishSuccessTest
2026-08-17 13:30:49 +02:00
}