1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 16:54:05 +00:00

Add a test that checks if pulling a pending tenant removes it from the pool

This commit is contained in:
lukinovec 2022-10-21 11:05:29 +02:00
parent 1899429723
commit 0769e187ac

View file

@ -95,11 +95,17 @@ test('tenancy can check for pending tenants', function () {
});
test('tenancy can pull a pending tenant', function () {
expect(Tenant::pullPending())->toBeNull();
expect(Tenant::pullPending())->toBeInstanceOf(Tenant::class);
});
test('pulling a tenant from the pending tenant pool removes it from the pool', function () {
Tenant::createPending();
expect(Tenant::pullPending())->toBeInstanceOf(Tenant::class);
expect(Tenant::onlyPending()->count())->toEqual(1);
Tenant::pullPendingFromPool();
expect(Tenant::onlyPending()->count())->toEqual(0);
});
test('tenancy can create if none are pending', function () {