Add workspace update functionality (#699)
* Add workspace update functionality * Refactor workspace settings header layout and edit button styling * Update workspace route and API endpoint to use root path --------- Co-authored-by: Julien Nahum <julien@nahum.net>
This commit is contained in:
@@ -5,7 +5,7 @@ it('can create and delete Workspace', function () {
|
||||
|
||||
for ($i = 1; $i <= 3; $i++) {
|
||||
$this->postJson(route('open.workspaces.create'), [
|
||||
'name' => 'Workspace Test - '.$i,
|
||||
'name' => 'Workspace Test - ' . $i,
|
||||
'icon' => '🧪',
|
||||
])
|
||||
->assertSuccessful()
|
||||
@@ -34,3 +34,30 @@ it('can create and delete Workspace', function () {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
it('can update workspace', function () {
|
||||
$user = $this->actingAsUser();
|
||||
|
||||
$this->postJson(route('open.workspaces.create'), [
|
||||
'name' => 'Workspace Test',
|
||||
'icon' => '🧪',
|
||||
])
|
||||
->assertSuccessful()
|
||||
->assertJson([
|
||||
'type' => 'success',
|
||||
'message' => 'Workspace created.',
|
||||
]);
|
||||
|
||||
expect($user->workspaces()->count())->toBe(1);
|
||||
|
||||
$workspace = $user->workspaces()->first();
|
||||
$this->putJson(route('open.workspaces.update', $workspace->id), [
|
||||
'name' => 'Workspace Test Updated',
|
||||
'icon' => '🔬',
|
||||
])
|
||||
->assertSuccessful()
|
||||
->assertJson([
|
||||
'type' => 'success',
|
||||
'message' => 'Workspace updated.',
|
||||
]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user