- Restriction UI warning

- create folder restriction
- fixed UI bugs
This commit is contained in:
Čarodej
2022-01-05 12:48:07 +01:00
parent c7c11fe5b9
commit b4887cea0e
21 changed files with 306 additions and 71 deletions
@@ -40,4 +40,45 @@ class MeteredBillingLimitationTest extends TestCase
$this->assertEquals(false, $user->canUpload());
}
/**
* @test
*/
public function it_can_create_new_folder()
{
$user = User::factory()
->create();
$this
->actingAs($user)
->postJson('/api/create-folder', [
'name' => 'New Folder',
])
->assertStatus(201);
$this->assertDatabaseHas('folders', [
'name' => 'New Folder',
]);
}
/**
* @test
*/
public function it_cant_create_new_folder_because_user_has_3_failed_payments()
{
$user = User::factory()
->hasFailedpayments(3)
->create();
$this
->actingAs($user)
->postJson('/api/create-folder', [
'name' => 'New Folder',
])
->assertStatus(401);
$this->assertDatabaseMissing('folders', [
'name' => 'New Folder',
]);
}
}