chore: init saasshop repo + sql migrations runner + gitee go
This commit is contained in:
55
tests/Feature/AdminAccessTest.php
Normal file
55
tests/Feature/AdminAccessTest.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Tests\TestCase;
|
||||
|
||||
class AdminAccessTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
public function test_admin_login_page_displays_new_console_naming(): void
|
||||
{
|
||||
$response = $this->get('/admin/login');
|
||||
|
||||
$response->assertOk();
|
||||
$response->assertSee('总台管理登录');
|
||||
$response->assertSee('登录总台管理');
|
||||
}
|
||||
|
||||
public function test_platform_admin_can_login_and_open_dashboard_with_new_naming(): void
|
||||
{
|
||||
$this->seed();
|
||||
|
||||
$response = $this->post('/admin/login', [
|
||||
'email' => 'platform.admin@demo.local',
|
||||
'password' => 'Platform@123456',
|
||||
]);
|
||||
|
||||
$response->assertRedirect('/admin');
|
||||
|
||||
$dashboard = $this->get('/admin');
|
||||
$dashboard->assertOk();
|
||||
$dashboard->assertSee('总台管理');
|
||||
$dashboard->assertSee('总台仪表盘');
|
||||
$dashboard->assertSee('站点管理');
|
||||
$dashboard->assertSee('订单监控');
|
||||
$dashboard->assertSee('商品巡检');
|
||||
$dashboard->assertSee('商品分类');
|
||||
}
|
||||
|
||||
public function test_merchant_admin_cannot_login_from_admin_entry(): void
|
||||
{
|
||||
$this->seed();
|
||||
|
||||
$response = $this->from('/admin/login')->post('/admin/login', [
|
||||
'email' => 'merchant.admin@demo.local',
|
||||
'password' => 'Merchant@123456',
|
||||
]);
|
||||
|
||||
$response->assertRedirect('/admin/login');
|
||||
|
||||
$this->get('/admin/login')->assertSee('当前账号是商家管理员,请从商家后台入口登录');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user