login()->loginNami(); $this->get('/setting/prevention')->assertComponent('prevention/Index')->assertOk(); } public function testItReceivesSettings(): void { $this->login()->loginNami(); $text = EditorRequestFactory::new()->text(50, 'lorem ipsum')->create(); app(PreventionSettings::class)->fill(['formmail' => $text])->save(); $this->get('/api/prevention') ->assertJsonPath('data.formmail.blocks.0.data.text', 'lorem ipsum'); } public function testItStoresSettings(): void { $this->login()->loginNami(); $text = EditorRequestFactory::new()->text(50, 'new lorem')->create(); $this->post('/api/prevention', ['formmail' => $text])->assertOk(); $this->assertEquals($text, app(PreventionSettings::class)->formmail); } }