added it_rename_file, it_move_file_to_another_folder, it_delete_multiple_files_softly

This commit is contained in:
Peter Papp
2021-02-27 11:17:04 +01:00
parent 97ade6c238
commit 3328fdebb0
4 changed files with 141 additions and 67 deletions

View File

@@ -81,7 +81,7 @@ class FolderTest extends TestCase
/**
* @test
*/
public function it_set_folder_icon()
public function it_set_folder_emoji()
{
$folder = Folder::factory(Folder::class)
->create();
@@ -145,37 +145,6 @@ class FolderTest extends TestCase
]);
}
/**
* @test
*/
public function it_move_folder_to_another_folder()
{
$root = Folder::factory(Folder::class)
->create();
$children = Folder::factory(Folder::class)
->create();
$user = User::factory(User::class)
->create();
Sanctum::actingAs($user);
$this->postJson("/api/move", [
'to_id' => $root->id,
'items' => [
[
'type' => 'folder',
'id' => $children->id,
]
],
])->assertStatus(204);
$this->assertEquals(
$root->id, Folder::find($children->id)->parent_id
);
}
/**
* @test
*/
@@ -227,6 +196,37 @@ class FolderTest extends TestCase
]);
}
/**
* @test
*/
public function it_move_folder_to_another_folder()
{
$root = Folder::factory(Folder::class)
->create();
$children = Folder::factory(Folder::class)
->create();
$user = User::factory(User::class)
->create();
Sanctum::actingAs($user);
$this->postJson("/api/move", [
'to_id' => $root->id,
'items' => [
[
'type' => 'folder',
'id' => $children->id,
]
],
])->assertStatus(204);
$this->assertEquals(
$root->id, Folder::find($children->id)->parent_id
);
}
/**
* @test
*/