doge 2 дней назад
Родитель
Сommit
53900b44f6
1 измененных файлов с 19 добавлено и 0 удалено
  1. 19 0
      tests/Integration/AgentWithdrawalChannelTest.php

+ 19 - 0
tests/Integration/AgentWithdrawalChannelTest.php

@@ -177,4 +177,23 @@ class AgentWithdrawalChannelTest extends TestCase
         $this->expectExceptionMessage('不支持此提现方式');
         $this->withdrawals->request($agent, $account['id'], '500', 'withdraw-old', 'outside-group');
     }
+
+    public function test_admin_list_still_shows_withdrawals_after_audit(): void
+    {
+        $this->setUpChannels(2);
+        $agent = $this->funded('1000', 1);
+        $jd = $this->withdrawals->saveAccount($agent, ['type' => 'JDpay', 'card_no' => 'JD-ADDR']);
+        $bank = $this->withdrawals->saveAccount($agent, ['type' => 'rgtx', 'payout_method' => 'bank', 'bank_name' => '工商银行',
+            'bank_branch' => '深圳支行', 'card_no' => '6222', 'real_name' => '张三']);
+        $first = $this->withdrawals->request($agent, $jd['id'], '100.00', 'withdraw-old', 'list-1');
+        $second = $this->withdrawals->request($agent, $bank['id'], '200.00', 'withdraw-old', 'list-2');
+        $this->fakeJd(['code' => 200, 'data' => ['balance' => '5000']], ['code' => 200, 'data' => ['orderNo' => 'JDR-1']]);
+        $this->withdrawals->audit($first->id, 'approve', 1);
+        $this->withdrawals->audit($second->id, 'approve', 1);
+        $response = (new \App\Http\Controllers\admin\Agent())->withdrawals(\Illuminate\Http\Request::create('/admin/agent/withdrawals'));
+        $body = $response->getData(true);
+        $this->assertSame(0, $body['code'], $body['msg'] ?? '');
+        $this->assertSame(2, $body['data']['total']);
+        $this->assertCount(2, $body['data']['list']);
+    }
 }