Files
saasshop/tests/Feature/AdminDashboardPlatformOpsOverviewShouldRenderTest.php

52 lines
1.7 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminDashboardPlatformOpsOverviewShouldRenderTest extends TestCase
{
use RefreshDatabase;
protected function loginAsPlatformAdmin(): void
{
$this->seed();
$this->post('/admin/login', [
'email' => 'platform.admin@demo.local',
'password' => 'Platform@123456',
])->assertRedirect('/admin');
}
public function test_dashboard_should_render_platform_ops_overview_block(): void
{
$this->loginAsPlatformAdmin();
$res = $this->get('/admin');
$res->assertOk();
$html = (string) $res->getContent();
$this->assertStringContainsString('data-role="dashboard-platform-ops-overview"', $html);
$this->assertStringContainsString('平台定位(运营版)', $html);
// 北极星指标
$this->assertStringContainsString('近30天已收款', $html);
$this->assertStringContainsString('活跃付费站点', $html);
$this->assertStringContainsString('续费成功率30天', $html);
// 漏斗近7天
$this->assertStringContainsString('收款漏斗近7天', $html);
$this->assertStringContainsString('待支付', $html);
$this->assertStringContainsString('已支付', $html);
$this->assertStringContainsString('已生效', $html);
// 待处理治理 Top3
$this->assertStringContainsString('待处理治理Top3', $html);
$this->assertStringContainsString('可BMPA', $html);
$this->assertStringContainsString('可同步', $html);
$this->assertStringContainsString('同步失败', $html);
}
}