Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BCrwHHnGCB5XH968Nxokqw
29 lines
949 B
PHP
29 lines
949 B
PHP
<?php
|
|
|
|
namespace Tests\Feature;
|
|
|
|
use App\Enums\ChannelType;
|
|
use App\Models\User;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
use Tests\TestCase;
|
|
|
|
class InboxChannelsTest extends TestCase
|
|
{
|
|
use RefreshDatabase;
|
|
|
|
public function test_webhook_channel_card_shows_both_urls(): void
|
|
{
|
|
$this->get('/', ['X-Remote-User' => 'luci']);
|
|
User::sole()->channels()->create([
|
|
'type' => ChannelType::Webhook,
|
|
'config' => ['deliver_url' => 'https://ha.test/api/webhook/hado', 'presence_url' => 'https://ha.test/api/presence'],
|
|
'enabled' => true,
|
|
]);
|
|
|
|
$this->get('/', ['X-Remote-User' => 'luci'])->assertOk()
|
|
->assertSee('https://ha.test/api/webhook/hado')
|
|
->assertSee('https://ha.test/api/presence')
|
|
->assertSeeInOrder(['доставка', 'https://ha.test/api/webhook/hado', 'присутствие', 'https://ha.test/api/presence']);
|
|
}
|
|
}
|