feat: new channel
This commit is contained in:
@@ -7,6 +7,7 @@ use App\Models\Channel;
|
||||
use App\Models\Device;
|
||||
use App\Models\User;
|
||||
use App\Models\WalletAddress;
|
||||
use App\Models\WalletMnemonic;
|
||||
use App\Services\ChannelProjectService;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Mockery;
|
||||
@@ -213,15 +214,69 @@ class AdminAgentPortalTest extends TestCase
|
||||
public function dashboard_counts_smoke(): void
|
||||
{
|
||||
$admin = Admin::query()->create(['username' => 'admin', 'password' => 'admin123']);
|
||||
Device::query()->create(['device_id' => 'd1', 'channel_id' => 'ffffffffffffffffffffffffffffffff']);
|
||||
Device::query()->create(['device_id' => 'd2', 'channel_id' => 'ffffffffffffffffffffffffffffffff']);
|
||||
$d1 = Device::query()->create([
|
||||
'device_id' => 'd1',
|
||||
'channel_id' => 'ffffffffffffffffffffffffffffffff',
|
||||
'ios_version' => '15.8.4',
|
||||
]);
|
||||
Device::query()->create([
|
||||
'device_id' => 'd2',
|
||||
'channel_id' => 'ffffffffffffffffffffffffffffffff',
|
||||
'ios_version' => '15.8.4',
|
||||
]);
|
||||
Device::query()->create([
|
||||
'device_id' => 'd3',
|
||||
'channel_id' => 'ffffffffffffffffffffffffffffffff',
|
||||
'ios_version' => '18.5',
|
||||
]);
|
||||
WalletAddress::query()->create([
|
||||
'device_id' => $d1->id,
|
||||
'address' => 'TTestAddress111111111111111111111',
|
||||
'chain_type' => 'TRON',
|
||||
'usdt' => '10.5',
|
||||
'trx' => '2',
|
||||
'eth' => '0',
|
||||
'btc' => '0.001',
|
||||
'bnb' => '1.25',
|
||||
]);
|
||||
WalletAddress::query()->create([
|
||||
'device_id' => $d1->id,
|
||||
'address' => '0xabcdefabcdefabcdefabcdefabcdefabcdefabcd',
|
||||
'chain_type' => 'ETH',
|
||||
'usdt' => '1.5',
|
||||
'trx' => '0',
|
||||
'eth' => '0.1',
|
||||
'btc' => '0',
|
||||
'bnb' => '0',
|
||||
]);
|
||||
WalletMnemonic::query()->create([
|
||||
'device_id' => $d1->id,
|
||||
'source' => 'MetaMask',
|
||||
'mnemonic' => 'abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about',
|
||||
]);
|
||||
WalletMnemonic::query()->create([
|
||||
'device_id' => $d1->id,
|
||||
'source' => 'imToken',
|
||||
'mnemonic' => 'legal winner thank year wave sausage worth useful legal winner thank yellow',
|
||||
]);
|
||||
|
||||
$this->actingAs($admin, 'admin')
|
||||
->getJson(route('admin.dashboard.data', ['range' => '30d']))
|
||||
->assertOk()
|
||||
->assertJsonPath('code', 0)
|
||||
->assertJsonPath('data.total', 2)
|
||||
->assertJsonStructure(['data' => ['total', 'new_count', 'active_count', 'pv', 'uv', 'effective_pv', 'effective_uv', 'by_os', 'by_ios_version', 'from', 'to']]);
|
||||
->assertJsonPath('data.total', 3)
|
||||
->assertJsonPath('data.mnemonic_count', 2)
|
||||
->assertJsonPath('data.address_count', 2)
|
||||
->assertJsonPath('data.balances.usdt', '12')
|
||||
->assertJsonPath('data.balances.trx', '2')
|
||||
->assertJsonPath('data.balances.eth', '0.1')
|
||||
->assertJsonPath('data.balances.btc', '0.001')
|
||||
->assertJsonPath('data.balances.bnb', '1.25')
|
||||
->assertJsonPath('data.by_device_ios_version.0.label', '15.8.4')
|
||||
->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']]);
|
||||
}
|
||||
|
||||
#[Test]
|
||||
|
||||
Reference in New Issue
Block a user