chore: update trmnl base url

This commit is contained in:
Benjamin Nussbaum 2026-01-28 12:10:29 +01:00
parent 31ca919ba9
commit 1e43aded77
16 changed files with 109 additions and 73 deletions

View file

@ -29,7 +29,7 @@ test('fetch device models job can be dispatched', function (): void {
test('fetch device models job handles successful api response', function (): void {
Http::fake([
'usetrmnl.com/api/palettes' => Http::response(['data' => []], 200),
'usetrmnl.com/api/models' => Http::response([
config('services.trmnl.base_url').'/api/models' => Http::response([
'data' => [
[
'name' => 'test-model',
@ -82,7 +82,7 @@ test('fetch device models job handles successful api response', function (): voi
test('fetch device models job handles multiple device models', function (): void {
Http::fake([
'usetrmnl.com/api/palettes' => Http::response(['data' => []], 200),
'usetrmnl.com/api/models' => Http::response([
config('services.trmnl.base_url').'/api/models' => Http::response([
'data' => [
[
'name' => 'model-1',
@ -136,7 +136,7 @@ test('fetch device models job handles multiple device models', function (): void
test('fetch device models job handles empty data array', function (): void {
Http::fake([
'usetrmnl.com/api/palettes' => Http::response(['data' => []], 200),
'usetrmnl.com/api/models' => Http::response([
config('services.trmnl.base_url').'/api/models' => Http::response([
'data' => [],
], 200),
]);
@ -158,7 +158,7 @@ test('fetch device models job handles empty data array', function (): void {
test('fetch device models job handles missing data field', function (): void {
Http::fake([
'usetrmnl.com/api/palettes' => Http::response(['data' => []], 200),
'usetrmnl.com/api/models' => Http::response([
config('services.trmnl.base_url').'/api/models' => Http::response([
'message' => 'No data available',
], 200),
]);
@ -180,7 +180,7 @@ test('fetch device models job handles missing data field', function (): void {
test('fetch device models job handles non-array data', function (): void {
Http::fake([
'usetrmnl.com/api/palettes' => Http::response(['data' => []], 200),
'usetrmnl.com/api/models' => Http::response([
config('services.trmnl.base_url').'/api/models' => Http::response([
'data' => 'invalid-data',
], 200),
]);
@ -202,7 +202,7 @@ test('fetch device models job handles non-array data', function (): void {
test('fetch device models job handles api failure', function (): void {
Http::fake([
'usetrmnl.com/api/palettes' => Http::response(['data' => []], 200),
'usetrmnl.com/api/models' => Http::response([
config('services.trmnl.base_url').'/api/models' => Http::response([
'error' => 'Internal Server Error',
], 500),
]);
@ -227,7 +227,7 @@ test('fetch device models job handles api failure', function (): void {
test('fetch device models job handles network exception', function (): void {
Http::fake([
'usetrmnl.com/api/palettes' => Http::response(['data' => []], 200),
'usetrmnl.com/api/models' => function (): void {
config('services.trmnl.base_url').'/api/models' => function (): void {
throw new Exception('Network connection failed');
},
]);
@ -249,7 +249,7 @@ test('fetch device models job handles network exception', function (): void {
test('fetch device models job handles device model with missing name', function (): void {
Http::fake([
'usetrmnl.com/api/palettes' => Http::response(['data' => []], 200),
'usetrmnl.com/api/models' => Http::response([
config('services.trmnl.base_url').'/api/models' => Http::response([
'data' => [
[
'label' => 'Model without name',
@ -280,7 +280,7 @@ test('fetch device models job handles device model with missing name', function
test('fetch device models job handles device model with partial data', function (): void {
Http::fake([
'usetrmnl.com/api/palettes' => Http::response(['data' => []], 200),
'usetrmnl.com/api/models' => Http::response([
config('services.trmnl.base_url').'/api/models' => Http::response([
'data' => [
[
'name' => 'minimal-model',
@ -329,7 +329,7 @@ test('fetch device models job updates existing device model', function (): void
Http::fake([
'usetrmnl.com/api/palettes' => Http::response(['data' => []], 200),
'usetrmnl.com/api/models' => Http::response([
config('services.trmnl.base_url').'/api/models' => Http::response([
'data' => [
[
'name' => 'existing-model',
@ -372,7 +372,7 @@ test('fetch device models job updates existing device model', function (): void
test('fetch device models job handles processing exception for individual model', function (): void {
Http::fake([
'usetrmnl.com/api/palettes' => Http::response(['data' => []], 200),
'usetrmnl.com/api/models' => Http::response([
config('services.trmnl.base_url').'/api/models' => Http::response([
'data' => [
[
'name' => 'valid-model',