*/
function timepickerConfig(string $html): array
{
preg_match('/materialTimepicker\((.*?), JSON\.parse\(\'(.*?)\'\)\)"/s', $html, $matches);
return json_decode((string) json_decode('"'.($matches[2] ?? '{}').'"'), true) ?? [];
}
it('draws a read-only field that opens the picker in a labelled dialog', function () {
$html = (string) $this->blade('');
expect($html)
->toContain('')
->toMatch('/]*id="starts"[^>]*readonly/s')
->toContain('value="14:30"')
->toContain('aria-haspopup="dialog"')
->toContain('aria-controls="starts-dialog"')
->toContain('aria-expanded="false"')
->toContain('aria-describedby="starts-support"')
->toContain('
In your time zone
')
->toContain('x-on:keydown.enter.prevent="show()"')
->toContain('data-timepicker-open')
->toContain('aria-label="Choose time"')
->toContain('