App zeigt Plugins ohne neue App-Version (0.60.0)
Some checks failed
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 10m32s
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 10m37s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 17m19s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 17m21s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 16m33s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 16m27s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 13m30s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 14m15s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 49s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m18s
Some checks failed
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 10m32s
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 10m37s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 17m19s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 17m21s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 16m33s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 16m27s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 13m30s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 14m15s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 49s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m18s
API: Feed, Aufgaben, Schnellzugriffe, Menü; Einmal-Link für eingebettete Portalseiten ohne Kopf- und Fußzeile. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
8cef93965e
commit
7b20d40994
145 changed files with 572 additions and 372 deletions
50
tests/Feature/Mobile/HomeApiTest.php
Normal file
50
tests/Feature/Mobile/HomeApiTest.php
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Mobile;
|
||||
|
||||
use App\Models\User;
|
||||
use App\Support\Settings;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Inertia\Testing\AssertableInertia as Assert;
|
||||
use Inhaus\Plugins\News\Models\NewsPost;
|
||||
use Tests\TestCase;
|
||||
|
||||
class HomeApiTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
public function test_app_gets_feed_tasks_apps_and_menu(): void
|
||||
{
|
||||
$post = NewsPost::factory()->create(['title' => 'Sommerfest', 'published_at' => now()->subHour(), 'must_read' => true]);
|
||||
app(Settings::class)->set('portal.quick_links', [['label' => 'Vivendi PEP', 'url' => 'https://pep.example.com', 'icon' => 'calendar', 'pinned' => true, 'new_tab' => true]]);
|
||||
$token = User::factory()->create()->createToken('App')->plainTextToken;
|
||||
|
||||
$this->withToken($token)->getJson('/api/v1/feed')->assertOk()
|
||||
->assertJsonPath('items.0.title', 'Sommerfest')
|
||||
->assertJsonPath('items.0.like.url', "/api/v1/news/{$post->slug}/like");
|
||||
$this->withToken($token)->getJson('/api/v1/tasks')->assertOk()->assertJsonPath('data.0.title', '„Sommerfest“ lesen und bestätigen');
|
||||
$this->withToken($token)->getJson('/api/v1/apps')->assertOk()->assertJsonPath('data.0.label', 'Vivendi PEP');
|
||||
$this->withToken($token)->getJson('/api/v1/menu')->assertOk()->assertJsonFragment(['label' => 'Neuigkeiten', 'href' => '/neuigkeiten']);
|
||||
}
|
||||
|
||||
public function test_web_session_opens_a_portal_page_embedded_once(): void
|
||||
{
|
||||
$user = User::factory()->create();
|
||||
$token = $user->createToken('App')->plainTextToken;
|
||||
|
||||
$url = $this->withToken($token)->postJson('/api/v1/web-session', ['path' => '/termine'])->assertOk()->json('data.url');
|
||||
$this->withToken($token)->postJson('/api/v1/web-session', ['path' => 'https://boese.example.com'])->assertUnprocessable();
|
||||
$this->withToken($token)->postJson('/api/v1/web-session', ['path' => '//boese.example.com'])->assertUnprocessable();
|
||||
|
||||
$this->app['auth']->forgetGuards();
|
||||
$path = parse_url($url, PHP_URL_PATH);
|
||||
|
||||
$this->withoutToken()->get($path)->assertRedirect('/termine');
|
||||
$this->assertAuthenticatedAs($user);
|
||||
$this->get('/termine')->assertInertia(fn (Assert $page) => $page->where('embedded', true));
|
||||
|
||||
// Nur einmal gültig
|
||||
$this->post('/logout');
|
||||
$this->get($path)->assertForbidden();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue