Skip to content

Commit 2685560

Browse files
committed
chore: fix failed coverage
1 parent ba910b0 commit 2685560

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/Generators/NovaTestGenerator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public function generateTests(): void
4848
'entity' => $this->model,
4949
'entities' => $this->getPluralName($this->model),
5050
'lower_entity' => Str::snake($this->model),
51+
'lower_first_entity' => Str::lcfirst($this->model),
5152
'lower_entities' => $this->getPluralName(Str::snake($this->model)),
5253
'actions' => $actions,
5354
'filters' => $filters,

stubs/nova_test.blade.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ class Nova{{$entity}}Test extends TestCase
1313
use NovaTestTrait;
1414

1515
protected static User $user;
16-
protected static ModelTestState ${{$lower_entity}}State;
16+
protected static ModelTestState ${{$lower_first_entity}}State;
1717

1818
public function setUp(): void
1919
{
2020
parent::setUp();
2121

2222
self::$user ??= User::find(1);
23-
self::${{$lower_entity}}State ??= new ModelTestState({{$entity}}::class);
23+
self::${{$lower_first_entity}}State ??= new ModelTestState({{$entity}}::class);
2424

2525
$this->skipDocumentationCollecting();
2626
}
@@ -40,7 +40,7 @@ public function testCreate(): void
4040
$this->assertEqualsFixture('create_{{$lower_entity}}_response.json', $response->json());
4141

4242
// TODO: Need to remove after first successful start
43-
self::${{$lower_entity}}State->assertChangesEqualsFixture('create_{{$lower_entities}}_state.json', true);
43+
self::${{$lower_first_entity}}State->assertChangesEqualsFixture('create_{{$lower_entities}}_state.json', true);
4444
}
4545

4646
public function testCreateNoAuth(): void
@@ -55,7 +55,7 @@ public function testCreateNoAuth(): void
5555
$response->assertUnauthorized();
5656
@endif
5757

58-
self::${{$lower_entity}}State->assertNotChanged();
58+
self::${{$lower_first_entity}}State->assertNotChanged();
5959
}
6060

6161
public function testCreateValidationError(): void
@@ -71,7 +71,7 @@ public function testCreateValidationError(): void
7171
// TODO: Need to remove after first successful start
7272
$this->assertEqualsFixture('create_validation_response.json', $response->json(), true);
7373

74-
self::${{$lower_entity}}State->assertNotChanged();
74+
self::${{$lower_first_entity}}State->assertNotChanged();
7575
}
7676

7777
public function testUpdate(): void
@@ -87,7 +87,7 @@ public function testUpdate(): void
8787
@endif
8888

8989
// TODO: Need to remove after first successful start
90-
self::${{$lower_entity}}State->assertChangesEqualsFixture('update_{{$lower_entities}}_state.json', true);
90+
self::${{$lower_first_entity}}State->assertChangesEqualsFixture('update_{{$lower_entities}}_state.json', true);
9191
}
9292

9393
public function testUpdateNotExists(): void
@@ -157,7 +157,7 @@ public function testDelete(): void
157157
@endif
158158

159159
// TODO: Need to remove after first successful start
160-
self::${{$lower_entity}}State->assertChangesEqualsFixture('delete_{{$lower_entities}}_state.json', true);
160+
self::${{$lower_first_entity}}State->assertChangesEqualsFixture('delete_{{$lower_entities}}_state.json', true);
161161
}
162162

163163
public function testDeleteNotExists(): void
@@ -281,7 +281,7 @@ public function testRun{{$entity}}Actions($action, $request, ${{$lower_entities}
281281
$this->assertEmpty($response->getContent());
282282

283283
// TODO: Need to remove after first successful start
284-
self::${{$lower_entity}}State->assertChangesEqualsFixture(${{$lower_entities}}StateFixture, true);
284+
self::${{$lower_first_entity}}State->assertChangesEqualsFixture(${{$lower_entities}}StateFixture, true);
285285
}
286286

287287
public function get{{$entity}}ActionsData(): array

0 commit comments

Comments
 (0)