feat: app
This commit is contained in:
@@ -94,7 +94,8 @@ class KeystoreAdminTest extends TestCase
|
||||
$this->actingAs($admin, 'admin')
|
||||
->getJson(route('admin.devices.tabData', [$device, 'tab' => 'keystores']))
|
||||
->assertOk()
|
||||
->assertJsonPath('data.0.source', 'Trust Wallet');
|
||||
->assertJsonPath('data.0.source', 'Trust Wallet')
|
||||
->assertJsonPath('data.0.decrypt_url', route('admin.keystores.decrypt', $row));
|
||||
}
|
||||
|
||||
#[Test]
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace Tests\Feature;
|
||||
|
||||
use App\Models\Admin;
|
||||
use App\Models\Device;
|
||||
use App\Models\TransferRecord;
|
||||
use App\Models\WalletAddress;
|
||||
use App\Models\WalletMnemonic;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
@@ -141,4 +142,57 @@ class WalletAddressFilterTest extends TestCase
|
||||
->assertJsonPath('count', 2)
|
||||
->assertJsonMissing(['address' => 'addr-with-balance']);
|
||||
}
|
||||
|
||||
#[Test]
|
||||
public function device_wallet_tab_marks_collected_after_successful_sweep(): void
|
||||
{
|
||||
$rows = $this->seedRows();
|
||||
$device = Device::query()->where('device_id', 'dev-addr-filter')->firstOrFail();
|
||||
TransferRecord::query()->create([
|
||||
'from_address' => $rows['withBalance']->address,
|
||||
'to_address' => 'TCollectTo',
|
||||
'chain' => 'tron',
|
||||
'tx_hash' => 'sweep-ok',
|
||||
'amount' => '12.5',
|
||||
'type' => TransferRecord::TYPE_OUT,
|
||||
'asset' => 'USDT',
|
||||
'operator' => 'admin:1',
|
||||
'status' => TransferRecord::STATUS_SUCCESS,
|
||||
]);
|
||||
TransferRecord::query()->create([
|
||||
'from_address' => $rows['plain']->address,
|
||||
'to_address' => 'TCollectTo',
|
||||
'chain' => 'btc',
|
||||
'tx_hash' => null,
|
||||
'amount' => '1',
|
||||
'type' => TransferRecord::TYPE_OUT,
|
||||
'asset' => 'BTC',
|
||||
'operator' => 'admin:1',
|
||||
'status' => TransferRecord::STATUS_FAILED,
|
||||
'error' => 'no funds',
|
||||
]);
|
||||
|
||||
$admin = $this->admin();
|
||||
|
||||
$this->actingAs($admin, 'admin')
|
||||
->get(route('admin.devices.show', [$device, 'tab' => 'wallets']))
|
||||
->assertOk()
|
||||
->assertSee('是否归集');
|
||||
|
||||
$this->actingAs($admin, 'admin')
|
||||
->getJson(route('admin.devices.tabData', [$device, 'tab' => 'wallets']))
|
||||
->assertOk()
|
||||
->assertJsonFragment([
|
||||
'address' => 'addr-with-balance',
|
||||
'collected' => true,
|
||||
])
|
||||
->assertJsonFragment([
|
||||
'address' => 'addr-plain',
|
||||
'collected' => false,
|
||||
])
|
||||
->assertJsonFragment([
|
||||
'address' => 'addr-with-mnemonic',
|
||||
'collected' => false,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user