<?php

namespace Tests\Unit;

use App\Http\Resources\Accounts\LinhasDoTempo\LinhasDoTempoResource;
use Tests\TestCase;

class LinhasDoTempoResourceTest extends TestCase {

    public function test_sanitize_process_html_remove_script_tags(): void {
        $resource = new LinhasDoTempoResource();
        $dirty = '<p>ok</p><script>alert(1)</script><strong>x</strong>';
        $clean = $resource->sanitizeProcessHtml($dirty);
        $this->assertStringContainsString('<p>ok</p>', $clean);
        $this->assertStringContainsString('<strong>x</strong>', $clean);
        $this->assertStringNotContainsString('<script', strtolower($clean));
    }

    public function test_parse_tags_input_splits_and_trims(): void {
        $resource = new LinhasDoTempoResource();
        $tags = $resource->parseTagsInput(' a , b ; c ');
        $this->assertSame(['a', 'b', 'c'], $tags);
    }

}
