61 lines
1.8 KiB
PHP
61 lines
1.8 KiB
PHP
<?php
|
|
|
|
use Vanguard\Announcements\Database\Seeders\AnnouncementsDatabaseSeeder;
|
|
|
|
/*
|
|
* The two official plugins ship their own compiled bundles to
|
|
* public/vendor/plugins and register their pages against window.Vanguard at
|
|
* runtime. A page that renders here proves the bundle loaded, resolved against
|
|
* the host's Vue instance and found the host UI kit on that runtime.
|
|
*/
|
|
|
|
beforeEach(function () {
|
|
$this->artisan('db:seed');
|
|
|
|
// announcements.manage lives in the plugin's own seeder, which the host
|
|
// seeder does not run. Without it the admin role is denied these routes.
|
|
$this->artisan('db:seed', ['--class' => AnnouncementsDatabaseSeeder::class]);
|
|
});
|
|
|
|
it('renders the announcements page from the plugin bundle', function () {
|
|
browserLogin();
|
|
|
|
visit('/announcements')
|
|
->assertNoJavaScriptErrors()
|
|
->assertSee('Announcements')
|
|
->assertSee('Create Announcement')
|
|
->assertSee('Creator')
|
|
->assertSee('Created At');
|
|
});
|
|
|
|
it('renders the announcement form from the plugin bundle', function () {
|
|
browserLogin();
|
|
|
|
visit('/announcements/create')
|
|
->assertNoJavaScriptErrors()
|
|
->assertSee('New Announcement')
|
|
->assertSee('Title')
|
|
->assertSee('Body')
|
|
->assertPresent('#title');
|
|
});
|
|
|
|
it('renders the activity log page from the plugin bundle', function () {
|
|
browserLogin();
|
|
|
|
visit('/activity')
|
|
->assertNoJavaScriptErrors()
|
|
->assertSee('Activity Log')
|
|
->assertSee('IP Address')
|
|
->assertSee('Log Time')
|
|
->assertSee('Search for Action');
|
|
});
|
|
|
|
it('renders the signed in users own activity log', function () {
|
|
browserLogin();
|
|
|
|
visit('/profile/activity')
|
|
->assertNoJavaScriptErrors()
|
|
->assertSee('Activity Log')
|
|
->assertSee('Message');
|
|
});
|