### ----------------------------------------------------
### -- Air
### -- Licenses: Artistic-2.0
### -- Authors: librasteve
### -- File: t/02-body.rakutest
### ----------------------------------------------------
use Test;
use Air::Functional;

plan 1;

#had to fine tune the stock symbol& END newline to make test work (editor trims trailing spaces)

my $main = main [
    div :class<jumbotron>, [
        h1 "Welcome to Dunder Mifflin!";        #use ; to stop <h1> slurping <p>
        p  [
            "Dunder Mifflin Inc. (stock symbol"; strong 'DMI'; ") ";
            q:to/END/;
            is a micro-cap regional paper and office
            supply distributor with an emphasis on servicing
            small-business clients.
            END
            ];
    ];

    p :hx-get<https://v2.jokeapi.dev/joke/Any?format=txt&safe-mode>,
        "Click Me";

    p '<div class="content">Escaped & Raw HTML!</div>';
];

my $expect =
    q:to/END/;

    <main>
    <div class="jumbotron">
    <h1>Welcome to Dunder Mifflin!</h1>
    <p>Dunder Mifflin Inc. (stock symbol
    <strong>DMI</strong>) is a micro-cap regional paper and office
    supply distributor with an emphasis on servicing
    small-business clients.

    </p>
    </div>
    <p hx-get="https://v2.jokeapi.dev/joke/Any?format=txt&safe-mode">Click Me</p>
    <p>&lt;div class=&quot;content&quot;&gt;Escaped &amp; Raw HTML!&lt;/div&gt;</p>
    </main>
    END

is $main, $expect.chomp, 'all-body';

done-testing;


