setSettings(['app-custom-head' => '']); $resp = $this->get('/login'); $resp->assertSee('console.log("cat")', false); } public function test_content_wrapped_in_specific_html_comments() { // These comments are used to identify head content for editor injection $this->setSettings(['app-custom-head' => '']); $resp = $this->get('/login'); $resp->assertSee('', false); $resp->assertSee('', false); } public function test_configured_content_does_not_show_on_settings_page() { $this->setSettings(['app-custom-head' => '']); $resp = $this->asAdmin()->get('/settings/features'); $resp->assertDontSee('console.log("cat")', false); } public function test_divs_in_js_preserved_in_configured_content() { $this->setSettings(['app-custom-head' => '']); $resp = $this->get('/login'); $resp->assertSee('
cat
', false); } public function test_nonce_application_handles_edge_cases() { $mockCSP = $this->mock(CspService::class); $mockCSP->shouldReceive('getNonce')->andReturn('abc123'); $content = trim(' '); $expectedOutput = trim(' '); $this->setSettings(['app-custom-head' => $content]); $resp = $this->get('/login'); $resp->assertSee($expectedOutput, false); } }