Skip to content

Commit

Permalink
Update FilamentPluginTest.php
Browse files Browse the repository at this point in the history
  • Loading branch information
Devonab committed Dec 30, 2024
1 parent 438599c commit 2e00a6a
Showing 1 changed file with 39 additions and 41 deletions.
80 changes: 39 additions & 41 deletions tests/Feature/FilamentPluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,47 +24,45 @@
->getRenderHook())
->toBe('panels::sidebar.footer');

describe('load time functionality', function () {
it('enables load time display without prefix')
->expect(fn () => EasyFooterPlugin::make()
->withLoadTime()
->isLoadTimeEnabled())
->toBeTrue();

it('enables load time with prefix', function () {
$plugin = EasyFooterPlugin::make()
->withLoadTime('Page générée en');

expect($plugin)
->isLoadTimeEnabled()->toBeTrue()
->getLoadTimePrefix()->toBe('Page générée en');
});

it('can disable load time explicitly')
->expect(fn () => EasyFooterPlugin::make()
->withLoadTime(enabled: false)
->isLoadTimeEnabled())
->toBeFalse();

it('keeps load time enabled when setting prefix', function () {
$plugin = EasyFooterPlugin::make()
->withLoadTime(enabled: false)
->withLoadTime('Page générée en');

expect($plugin)
->isLoadTimeEnabled()->toBeTrue()
->getLoadTimePrefix()->toBe('Page générée en');
});

it('can update prefix while keeping enabled state', function () {
$plugin = EasyFooterPlugin::make()
->withLoadTime('Initial prefix')
->withLoadTime('New prefix');

expect($plugin)
->isLoadTimeEnabled()->toBeTrue()
->getLoadTimePrefix()->toBe('New prefix');
});
it('enables load time display without prefix')
->expect(fn () => EasyFooterPlugin::make()
->withLoadTime()
->isLoadTimeEnabled())
->toBeTrue();

it('enables load time with prefix', function () {
$plugin = EasyFooterPlugin::make()
->withLoadTime('Page générée en');

expect($plugin)
->isLoadTimeEnabled()->toBeTrue()
->getLoadTimePrefix()->toBe('Page générée en');
});

it('can disable load time explicitly')
->expect(fn () => EasyFooterPlugin::make()
->withLoadTime(enabled: false)
->isLoadTimeEnabled())
->toBeFalse();

it('keeps load time enabled when setting prefix', function () {
$plugin = EasyFooterPlugin::make()
->withLoadTime(enabled: false)
->withLoadTime('Page générée en');

expect($plugin)
->isLoadTimeEnabled()->toBeTrue()
->getLoadTimePrefix()->toBe('Page générée en');
});

it('can update prefix while keeping enabled state', function () {
$plugin = EasyFooterPlugin::make()
->withLoadTime('Initial prefix')
->withLoadTime('New prefix');

expect($plugin)
->isLoadTimeEnabled()->toBeTrue()
->getLoadTimePrefix()->toBe('New prefix');
});

it('limits and filters links correctly', function () {
Expand Down

0 comments on commit 2e00a6a

Please sign in to comment.