Skip to content

Commit

Permalink
fix: Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cjmellor committed Jul 12, 2023
1 parent 95e574c commit 586034c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/Concerns/HasAchievementsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
$this->user->grantAchievement($this->achievement);
Event::assertDispatched(event: AchievementAwarded::class);

$this->user->grantAchievement($this->achievement, 100); // grant an achievement with 100% progress
$this->user->grantAchievement(Achievement::factory()->create(), 100); // grant an achievement with 100% progress
Event::assertDispatched(event: AchievementAwarded::class);
});
});
Expand Down Expand Up @@ -69,15 +69,15 @@

test(description: 'a User can see all Achievements', closure: function (): void {
$this->user->grantAchievement($this->achievement);
$this->user->grantAchievement($this->achievement, 50);
$this->user->grantAchievement(Achievement::factory()->create(), 50);
$this->user->grantAchievement(Achievement::factory()->secret()->create());

expect($this->user)->allAchievements->toHaveCount(3);
});

it(description: 'can fetch Achievements that have a certain amount of progression', closure: function (): void {
$this->user->grantAchievement($this->achievement, 50);
$this->user->grantAchievement($this->achievement, 50);
$this->user->grantAchievement(Achievement::factory()->create(), 50);

expect($this->user)->achievements->first()->pivot->withProgress(50)->toHaveCount(2);
});
Expand Down

0 comments on commit 586034c

Please sign in to comment.