mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-13 15:07:49 +00:00
This commit is contained in:
parent
a88e72b75e
commit
ba3bf31bb7
29 changed files with 2379 additions and 215 deletions
|
|
@ -11,7 +11,7 @@ beforeEach(function () {
|
|||
|
||||
test('it creates new firmware record when polling', function () {
|
||||
Http::fake([
|
||||
'usetrmnl.com/api/firmware/latest' => Http::response([
|
||||
'https://usetrmnl.com/api/firmware/latest' => Http::response([
|
||||
'version' => '1.0.0',
|
||||
'url' => 'https://example.com/firmware.bin',
|
||||
], 200),
|
||||
|
|
@ -33,7 +33,7 @@ test('it updates existing firmware record when polling', function () {
|
|||
]);
|
||||
|
||||
Http::fake([
|
||||
'usetrmnl.com/api/firmware/latest' => Http::response([
|
||||
'https://usetrmnl.com/api/firmware/latest' => Http::response([
|
||||
'version' => '1.0.0',
|
||||
'url' => 'https://new-url.com/firmware.bin',
|
||||
], 200),
|
||||
|
|
@ -53,7 +53,7 @@ test('it marks previous firmware as not latest when new version is found', funct
|
|||
]);
|
||||
|
||||
Http::fake([
|
||||
'usetrmnl.com/api/firmware/latest' => Http::response([
|
||||
'https://usetrmnl.com/api/firmware/latest' => Http::response([
|
||||
'version' => '1.1.0',
|
||||
'url' => 'https://example.com/firmware.bin',
|
||||
], 200),
|
||||
|
|
@ -67,7 +67,7 @@ test('it marks previous firmware as not latest when new version is found', funct
|
|||
|
||||
test('it handles connection exception gracefully', function () {
|
||||
Http::fake([
|
||||
'usetrmnl.com/api/firmware/latest' => function () {
|
||||
'https://usetrmnl.com/api/firmware/latest' => function () {
|
||||
throw new ConnectionException('Connection failed');
|
||||
},
|
||||
]);
|
||||
|
|
@ -80,7 +80,7 @@ test('it handles connection exception gracefully', function () {
|
|||
|
||||
test('it handles invalid response gracefully', function () {
|
||||
Http::fake([
|
||||
'usetrmnl.com/api/firmware/latest' => Http::response(null, 200),
|
||||
'https://usetrmnl.com/api/firmware/latest' => Http::response(null, 200),
|
||||
]);
|
||||
|
||||
(new FirmwarePollJob)->handle();
|
||||
|
|
@ -91,7 +91,7 @@ test('it handles invalid response gracefully', function () {
|
|||
|
||||
test('it handles missing version in response gracefully', function () {
|
||||
Http::fake([
|
||||
'usetrmnl.com/api/firmware/latest' => Http::response([
|
||||
'https://usetrmnl.com/api/firmware/latest' => Http::response([
|
||||
'url' => 'https://example.com/firmware.bin',
|
||||
], 200),
|
||||
]);
|
||||
|
|
@ -104,7 +104,7 @@ test('it handles missing version in response gracefully', function () {
|
|||
|
||||
test('it handles missing url in response gracefully', function () {
|
||||
Http::fake([
|
||||
'usetrmnl.com/api/firmware/latest' => Http::response([
|
||||
'https://usetrmnl.com/api/firmware/latest' => Http::response([
|
||||
'version' => '1.0.0',
|
||||
], 200),
|
||||
]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue