54 lines
1.3 KiB
PHP
54 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace Tests\Browser;
|
|
|
|
use Laravel\Dusk\Browser;
|
|
use Tests\DuskTestCase;
|
|
|
|
class GamePageTest extends DuskTestCase
|
|
{
|
|
/**
|
|
* Trang game hiển thị đúng khi chưa đăng nhập.
|
|
*/
|
|
public function test_game_page_loads_when_guest(): void
|
|
{
|
|
$this->browse(function (Browser $browser) {
|
|
$browser->visit('/game')
|
|
->assertPathIs('/game');
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Trang chủ (/) redirect về game.
|
|
*/
|
|
public function test_root_redirects_to_game(): void
|
|
{
|
|
$this->browse(function (Browser $browser) {
|
|
$browser->visit('/')
|
|
->assertPathIs('/game');
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Trang game hiển thị vòng quay may mắn.
|
|
*/
|
|
public function test_game_page_shows_lucky_wheel(): void
|
|
{
|
|
$this->browse(function (Browser $browser) {
|
|
$browser->visit('/game')
|
|
->assertPresent('#wheel, canvas, .wheel, [id*="wheel"], [class*="wheel"]');
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Popup luật chơi có thể tải được.
|
|
*/
|
|
public function test_game_rule_endpoint_returns_content(): void
|
|
{
|
|
$this->browse(function (Browser $browser) {
|
|
$browser->visit('/game/rule')
|
|
->assertSee('luật');
|
|
});
|
|
}
|
|
}
|