File: br.php

package info (click to toggle)
php-nunomaduro-termwind 2.3.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,172 kB
  • sloc: php: 3,969; makefile: 34
file content (27 lines) | stat: -rw-r--r-- 618 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php

use function Termwind\parse;

it('renders the element', function () {
    $html = parse('<br/>');

    expect($html)->toBe("\r");
});

it('renders the text with line-breaks', function () {
    $html = parse("<div>line<br/>\n break</div>");

    expect($html)->toBe("line\nbreak");
});

it('does not render if class hidden is added', function () {
    $html = parse("<div>A<br class='hidden' />B</div>");

    expect($html)->toBe('AB');
});

it('only renders one line break if the block class is added', function () {
    $html = parse("<div>A<br class='block' />B</div>");

    expect($html)->toBe("A\nB");
});