mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-13 15:07:49 +00:00
fix(#71): device specific sleep and setup images
Some checks failed
tests / ci (push) Has been cancelled
Some checks failed
tests / ci (push) Has been cancelled
This commit is contained in:
parent
6ae3e023d4
commit
3e5ba47a12
35 changed files with 614 additions and 20 deletions
|
|
@ -812,10 +812,10 @@ test('device in sleep mode returns sleep image and correct refresh rate', functi
|
|||
'fw-version' => '1.0.0',
|
||||
])->get('/api/display');
|
||||
|
||||
$response->assertOk()
|
||||
->assertJson([
|
||||
'filename' => 'sleep.png',
|
||||
]);
|
||||
$response->assertOk();
|
||||
|
||||
// The filename should be a UUID-based PNG file since we're generating from template
|
||||
expect($response['filename'])->toMatch('/^[a-f0-9-]+\.png$/');
|
||||
expect($response['refresh_rate'])->toBeGreaterThan(0);
|
||||
|
||||
Carbon\Carbon::setTestNow(); // Clear test time
|
||||
|
|
@ -867,8 +867,10 @@ test('device returns sleep.png and correct refresh time when paused', function (
|
|||
|
||||
$response->assertOk();
|
||||
$json = $response->json();
|
||||
expect($json['filename'])->toBe('sleep.png');
|
||||
expect($json['image_url'])->toContain('sleep.png');
|
||||
|
||||
// The filename should be a UUID-based PNG file since we're generating from template
|
||||
expect($json['filename'])->toMatch('/^[a-f0-9-]+\.png$/');
|
||||
expect($json['image_url'])->toContain('images/generated/');
|
||||
expect($json['refresh_rate'])->toBeLessThanOrEqual(3600); // ~60 min
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue