withoutExceptionHandling()->login()->loginNami(); test()->get('/setting/module')->assertSeeLivewire(SettingView::class); }); it('it displays acive modules', function () { test()->withoutExceptionHandling()->login()->loginNami(); app(ModuleSettings::class)->fill(['modules' => ['bill']])->save(); Livewire::test(SettingView::class) ->assertSee('Module') ->assertSee('Ausbildung') ->assertSet('modules', fn ($modules) => $modules === ['bill']) ->assertSeeHtml('data-active'); }); it('it saves modules', function () { test()->withoutExceptionHandling()->login()->loginNami(); app(ModuleSettings::class)->fill(['modules' => ['bill']])->save(); Livewire::test(SettingView::class) ->set('modules', ['bill', 'course']) ->call('save') ->assertDispatched('success', 'Einstellungen gespeichert.'); test()->assertEquals(['bill', 'course'], app(ModuleSettings::class)->modules); }); it('test module must exist', function () { test()->withoutExceptionHandling()->login()->loginNami(); app(ModuleSettings::class)->fill(['modules' => ['bill']])->save(); Livewire::test(SettingView::class) ->set('modules', ['bill', 'lala']) ->call('save') ->assertHasErrors('modules.1'); });