blade(''))
->toContain('role="progressbar"')
->toContain('aria-label="Progress"')
->toContain('aria-valuemin="0"')
->toContain('aria-valuemax="100"')
->toContain('aria-valuenow="42"')
->toContain('data-value="42"')
->toContain('x-data="materialProgress"');
});
it('leaves out aria-valuenow while indeterminate', function () {
expect((string) $this->blade(''))
->toContain('role="progressbar"')
->toContain('aria-label="Uploading"')
->not->toContain('aria-valuenow')
->not->toContain('data-value');
});
it('says nothing where something else already does', function () {
expect((string) $this->blade(''))
->toContain('aria-hidden="true"')
->not->toContain('role="progressbar"')
->not->toContain('aria-label')
->not->toContain('aria-valuenow');
});
it('clamps the value into its range', function (string $template, string $now, string $max) {
expect((string) $this->blade($template))
->toContain("aria-valuenow=\"{$now}\"")
->toContain("aria-valuemax=\"{$max}\"")
->toContain("data-value=\"{$now}\"");
})->with([
'below zero' => ['', '0', '100'],
'above the maximum' => ['', '100', '100'],
'a custom maximum' => ['', '3.5', '5'],
'a maximum that cannot be one' => ['', '30', '100'],
]);
it('draws the first frame on the server, at the value', function () {
expect((string) $this->blade(''))
->toContain('