chore(governance): block batch activate when syncable_only conflicts with sync status
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Tests\TestCase;
|
||||
|
||||
class AdminPlatformOrderIndexBatchActivateButtonShouldDisableWhenSyncableOnlyButSyncStatusNotUnsyncedTest 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_batch_activate_button_should_disable_when_syncable_only_checked_but_sync_status_is_failed(): void
|
||||
{
|
||||
$this->loginAsPlatformAdmin();
|
||||
|
||||
$res = $this->get('/admin/platform-orders?syncable_only=1&sync_status=failed');
|
||||
$res->assertOk();
|
||||
|
||||
$html = (string) $res->getContent();
|
||||
|
||||
$this->assertStringContainsString('批量同步订阅(当前筛选范围)', $html);
|
||||
$this->assertStringContainsString('disabled', $html);
|
||||
$this->assertStringContainsString('data-role="batch-activate-subscriptions-blocked-hint"', $html);
|
||||
$this->assertStringContainsString('sync_status=unsynced', $html);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user