feat: new chain

This commit is contained in:
hashbro
2026-08-11 03:27:54 +08:00
parent 41023b16f4
commit 4983077085
17 changed files with 94 additions and 47 deletions
+9
View File
@@ -189,8 +189,11 @@ class AdminAgentPortalTest extends TestCase
$admin = Admin::query()->create(['username' => 'admin', 'password' => 'admin123']);
$agent = User::query()->create(['username' => 'filter-me', 'password' => 'secret12', 'status' => 1]);
$ch = 'dddddddddddddddddddddddddddddddd';
$official = 'cccccccccccccccccccccccccccccccc';
Channel::query()->create(['channel_id' => $ch, 'user_id' => $agent->id, 'status' => 1]);
Channel::query()->create(['channel_id' => $official, 'user_id' => Channel::OFFICIAL_USER_ID, 'status' => 1]);
Device::query()->create(['device_id' => 'mine', 'channel_id' => $ch]);
Device::query()->create(['device_id' => 'official-dev', 'channel_id' => $official]);
Device::query()->create(['device_id' => 'other', 'channel_id' => 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee']);
$this->actingAs($admin, 'admin')
@@ -198,6 +201,12 @@ class AdminAgentPortalTest extends TestCase
->assertOk()
->assertJsonPath('count', 1)
->assertJsonPath('data.0.device_id', 'mine');
$this->actingAs($admin, 'admin')
->getJson(route('admin.devices.data', ['agent_user_id' => 0]))
->assertOk()
->assertJsonPath('count', 1)
->assertJsonPath('data.0.device_id', 'official-dev');
}
#[Test]