mirror of
https://github.com/archtechx/tenancy.git
synced 2026-05-06 19:44:03 +00:00
Improve test
Address Copilot suggestions, add comments.
This commit is contained in:
parent
517861506b
commit
56e2d85087
1 changed files with 8 additions and 2 deletions
|
|
@ -115,8 +115,14 @@ test('withoutPending chained with where clauses returns correct results', functi
|
||||||
$tenant = Tenant::create();
|
$tenant = Tenant::create();
|
||||||
$pendingTenant = Tenant::createPending();
|
$pendingTenant = Tenant::createPending();
|
||||||
|
|
||||||
expect(Tenant::withoutPending()->where('id', $tenant->id)->first()->id)->toBe($tenant->id);
|
$foundTenant = Tenant::withoutPending()->where('id', $tenant->id)->first();
|
||||||
expect(Tenant::withoutPending()->where('id', 'nonexistent-id')->first())->toBeNull();
|
expect($foundTenant)->not()->toBeNull();
|
||||||
|
|
||||||
|
// The query returned the correct tenant
|
||||||
|
expect($foundTenant->id)->toBe($tenant->id);
|
||||||
|
// No tenant with this ID exists, the query returns null
|
||||||
|
expect(Tenant::withoutPending()->where('id', Str::random(8) . 'nonexistent-id')->first())->toBeNull();
|
||||||
|
// withoutPending() correctly excludes the pending tenant from the query
|
||||||
expect(Tenant::withoutPending()->where('id', $pendingTenant->id)->first())->toBeNull();
|
expect(Tenant::withoutPending()->where('id', $pendingTenant->id)->first())->toBeNull();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue