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:
Chirag Chhatrala
2025-02-12 18:13:55 +05:30
committed by GitHub
parent 1f9a1f835f
commit aae28d09cc
5 changed files with 95 additions and 21 deletions

View File

@@ -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.',
]);
});