2026-01-18 23:33:45 +00:00
|
|
|
<?php
|
|
|
|
|
|
refactor: settings redesign, Spanish translations, language system, strict_types
Settings pages:
- Redesign layout to match Sendkit (max-w-4xl, space-y-12, Separator sections)
- Merge Members page into Workspace settings with Table, invite Dialog, ConfirmDeleteModal
- Add workspace logo upload/delete routes and controller methods
- Translate all hardcoded strings in Workspace.vue modals
Language system:
- Drop languages table, replace language_id FK with locale string column on users
- Create config/languages.php for available languages and default locale
- Add Spanish (es) translations (13 files)
- Simplify HandleInertiaRequests, ProfileController, RegisteredUserController
Code quality:
- Add declare(strict_types=1) to all PHP files
- Fix MastodonPublisher using wrong attribute (filename -> original_filename)
- Fix HasMediaTest for new has_photo/photo_url accessors
- Fix PublishToSocialPlatformTest type error revealed by strict_types
- Remove orphaned Language model from AppServiceProvider morph map
- Update User TypeScript interface (has_photo, photo_url, locale)
- Eager load media relation on workspaces to prevent N+1
- Add 8 new tests for workspace logo upload/delete
- Update workspace settings test to assert members/invitations props
All 710 tests passing.
2026-03-30 03:20:43 +00:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
2026-01-18 23:33:45 +00:00
|
|
|
use App\Enums\UserWorkspace\Role as WorkspaceRole;
|
|
|
|
|
use App\Mail\WorkspaceInvite as WorkspaceInviteMail;
|
2026-04-15 01:22:04 +00:00
|
|
|
use App\Models\Account;
|
|
|
|
|
use App\Models\Invite;
|
2026-01-18 23:33:45 +00:00
|
|
|
use App\Models\User;
|
|
|
|
|
use App\Models\Workspace;
|
|
|
|
|
use Illuminate\Support\Facades\Mail;
|
|
|
|
|
|
|
|
|
|
beforeEach(function () {
|
|
|
|
|
Mail::fake();
|
2026-04-15 01:22:04 +00:00
|
|
|
config(['trypost.self_hosted' => true]);
|
|
|
|
|
|
|
|
|
|
$this->account = Account::factory()->create();
|
|
|
|
|
$this->user = User::factory()->create([
|
|
|
|
|
'account_id' => $this->account->id,
|
|
|
|
|
]);
|
|
|
|
|
$this->account->update(['owner_id' => $this->user->id]);
|
|
|
|
|
$this->workspace = Workspace::factory()->create([
|
|
|
|
|
'user_id' => $this->user->id,
|
|
|
|
|
'account_id' => $this->account->id,
|
|
|
|
|
]);
|
|
|
|
|
$this->workspace->members()->attach($this->user->id, ['role' => WorkspaceRole::Admin->value]);
|
2026-01-18 23:33:45 +00:00
|
|
|
$this->user->update(['current_workspace_id' => $this->workspace->id]);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Index tests
|
|
|
|
|
test('members index requires authentication', function () {
|
2026-03-29 22:24:28 +00:00
|
|
|
$response = $this->get(route('app.members'));
|
2026-01-18 23:33:45 +00:00
|
|
|
|
|
|
|
|
$response->assertRedirect(route('login'));
|
|
|
|
|
});
|
|
|
|
|
|
2026-05-02 15:22:42 +00:00
|
|
|
test('members page shows members and invites', function () {
|
2026-04-15 01:22:04 +00:00
|
|
|
Invite::factory()->create([
|
|
|
|
|
'account_id' => $this->account->id,
|
|
|
|
|
'invited_by' => $this->user->id,
|
|
|
|
|
'workspaces' => [$this->workspace->id],
|
2026-01-18 23:33:45 +00:00
|
|
|
]);
|
|
|
|
|
|
2026-05-02 15:22:42 +00:00
|
|
|
$response = $this->actingAs($this->user)->get(route('app.members'));
|
2026-01-18 23:33:45 +00:00
|
|
|
|
|
|
|
|
$response->assertOk();
|
|
|
|
|
$response->assertInertia(fn ($page) => $page
|
2026-05-02 15:22:42 +00:00
|
|
|
->component('settings/Members', false)
|
2026-01-18 23:33:45 +00:00
|
|
|
->has('workspace')
|
|
|
|
|
->has('members')
|
2026-05-02 15:22:42 +00:00
|
|
|
->has('invites')
|
|
|
|
|
->has('owner')
|
|
|
|
|
->has('roles')
|
2026-01-18 23:33:45 +00:00
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Store invite tests
|
|
|
|
|
test('store invite requires authentication', function () {
|
2026-03-29 22:24:28 +00:00
|
|
|
$response = $this->post(route('app.invites.store'), [
|
2026-01-18 23:33:45 +00:00
|
|
|
'email' => 'test@example.com',
|
|
|
|
|
'role' => WorkspaceRole::Member->value,
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$response->assertRedirect(route('login'));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('store invite creates invite and sends email', function () {
|
2026-03-29 22:24:28 +00:00
|
|
|
$response = $this->actingAs($this->user)->post(route('app.invites.store'), [
|
2026-01-18 23:33:45 +00:00
|
|
|
'email' => 'newmember@example.com',
|
|
|
|
|
'role' => WorkspaceRole::Member->value,
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$response->assertRedirect();
|
|
|
|
|
|
2026-04-15 01:22:04 +00:00
|
|
|
$this->assertDatabaseHas('invites', [
|
|
|
|
|
'account_id' => $this->account->id,
|
2026-01-18 23:33:45 +00:00
|
|
|
'email' => 'newmember@example.com',
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
Mail::assertQueued(WorkspaceInviteMail::class);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('store invite fails if invite already exists', function () {
|
2026-04-15 01:22:04 +00:00
|
|
|
Invite::factory()->create([
|
|
|
|
|
'account_id' => $this->account->id,
|
|
|
|
|
'invited_by' => $this->user->id,
|
2026-01-18 23:33:45 +00:00
|
|
|
'email' => 'existing@example.com',
|
2026-04-15 01:22:04 +00:00
|
|
|
'workspaces' => [$this->workspace->id],
|
2026-01-18 23:33:45 +00:00
|
|
|
]);
|
|
|
|
|
|
2026-03-29 22:24:28 +00:00
|
|
|
$response = $this->actingAs($this->user)->post(route('app.invites.store'), [
|
2026-01-18 23:33:45 +00:00
|
|
|
'email' => 'existing@example.com',
|
|
|
|
|
'role' => WorkspaceRole::Member->value,
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$response->assertSessionHasErrors('email');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('store invite fails if user is already member', function () {
|
2026-04-15 01:22:04 +00:00
|
|
|
$member = User::factory()->create([
|
|
|
|
|
'account_id' => $this->account->id,
|
|
|
|
|
]);
|
2026-01-18 23:33:45 +00:00
|
|
|
$this->workspace->members()->attach($member->id, ['role' => WorkspaceRole::Member->value]);
|
|
|
|
|
|
2026-03-29 22:24:28 +00:00
|
|
|
$response = $this->actingAs($this->user)->post(route('app.invites.store'), [
|
2026-01-18 23:33:45 +00:00
|
|
|
'email' => $member->email,
|
|
|
|
|
'role' => WorkspaceRole::Member->value,
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$response->assertSessionHasErrors('email');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Destroy invite tests
|
|
|
|
|
test('destroy invite requires authentication', function () {
|
2026-04-15 01:22:04 +00:00
|
|
|
$invite = Invite::factory()->create([
|
|
|
|
|
'account_id' => $this->account->id,
|
|
|
|
|
'invited_by' => $this->user->id,
|
|
|
|
|
'workspaces' => [$this->workspace->id],
|
2026-01-18 23:33:45 +00:00
|
|
|
]);
|
|
|
|
|
|
2026-03-29 22:24:28 +00:00
|
|
|
$response = $this->delete(route('app.invites.destroy', $invite));
|
2026-01-18 23:33:45 +00:00
|
|
|
|
|
|
|
|
$response->assertRedirect(route('login'));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('destroy invite deletes invite', function () {
|
2026-04-15 01:22:04 +00:00
|
|
|
$invite = Invite::factory()->create([
|
|
|
|
|
'account_id' => $this->account->id,
|
|
|
|
|
'invited_by' => $this->user->id,
|
|
|
|
|
'workspaces' => [$this->workspace->id],
|
2026-01-18 23:33:45 +00:00
|
|
|
]);
|
|
|
|
|
|
2026-03-29 22:24:28 +00:00
|
|
|
$response = $this->actingAs($this->user)->delete(route('app.invites.destroy', $invite));
|
2026-01-18 23:33:45 +00:00
|
|
|
|
|
|
|
|
$response->assertRedirect();
|
2026-04-15 01:22:04 +00:00
|
|
|
expect(Invite::find($invite->id))->toBeNull();
|
2026-01-18 23:33:45 +00:00
|
|
|
});
|
|
|
|
|
|
2026-04-15 01:22:04 +00:00
|
|
|
test('destroy invite returns 404 for other account invite', function () {
|
|
|
|
|
$otherAccount = Account::factory()->create();
|
|
|
|
|
$invite = Invite::factory()->create([
|
|
|
|
|
'account_id' => $otherAccount->id,
|
|
|
|
|
'workspaces' => [],
|
2026-01-18 23:33:45 +00:00
|
|
|
]);
|
|
|
|
|
|
2026-03-29 22:24:28 +00:00
|
|
|
$response = $this->actingAs($this->user)->delete(route('app.invites.destroy', $invite));
|
2026-01-18 23:33:45 +00:00
|
|
|
|
|
|
|
|
$response->assertNotFound();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Remove member tests
|
|
|
|
|
test('remove member requires authentication', function () {
|
2026-04-15 01:22:04 +00:00
|
|
|
$member = User::factory()->create([
|
|
|
|
|
'account_id' => $this->account->id,
|
|
|
|
|
]);
|
2026-01-18 23:33:45 +00:00
|
|
|
$this->workspace->members()->attach($member->id, ['role' => WorkspaceRole::Member->value]);
|
|
|
|
|
|
2026-03-29 22:24:28 +00:00
|
|
|
$response = $this->delete(route('app.members.remove', $member));
|
2026-01-18 23:33:45 +00:00
|
|
|
|
|
|
|
|
$response->assertRedirect(route('login'));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('remove member removes user from workspace', function () {
|
2026-04-15 01:22:04 +00:00
|
|
|
$member = User::factory()->create([
|
|
|
|
|
'account_id' => $this->account->id,
|
|
|
|
|
]);
|
2026-01-18 23:33:45 +00:00
|
|
|
$this->workspace->members()->attach($member->id, ['role' => WorkspaceRole::Member->value]);
|
|
|
|
|
|
2026-03-29 22:24:28 +00:00
|
|
|
$response = $this->actingAs($this->user)->delete(route('app.members.remove', $member));
|
2026-01-18 23:33:45 +00:00
|
|
|
|
|
|
|
|
$response->assertRedirect();
|
|
|
|
|
expect($this->workspace->hasMember($member))->toBeFalse();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('remove member fails for owner', function () {
|
2026-03-29 22:24:28 +00:00
|
|
|
$response = $this->actingAs($this->user)->delete(route('app.members.remove', $this->user));
|
2026-01-18 23:33:45 +00:00
|
|
|
|
|
|
|
|
$response->assertSessionHasErrors('member');
|
|
|
|
|
});
|
refactor: auth split layout, subscribe redesign, onboarding, i18n, cookie locale
Auth pages:
- Create AuthSplitLayout with animated feature slides (6 slides, 3 languages)
- All auth pages use split layout (form left, visual right)
- Add show/hide password toggle with tooltip on Register
- Legal footer only shown on Register via showLegal prop
Subscribe page:
- Redesign to match auth card pattern (centered, clean)
- Platform icons, feature checklist, dynamic trial days (trialDays - 1)
- Add "Switch workspace" link
- Full i18n (en, es, pt-BR)
Onboarding:
- Rename URLs: step1 -> role, step2 -> connect
- Add enforceStep() to prevent skipping/going back steps
- Redirect /onboarding to /onboarding/role
- Redesign Step2 with AuthSplitLayout and compact platform list
- 21 tests covering all step enforcement scenarios
Workspaces page:
- Redesign with AuthSplitLayout (list with avatars, current badge)
Language system:
- Move locale from DB to cookie (forever, unencrypted, session.domain)
- Create SetLocale middleware (sets cookie if missing, validates against config)
- Rename lang/pt-br to lang/pt-BR
- Add dayjs es locale
Other:
- Copy utils.ts from sendkit (formatNumber, formatMoney, copyToClipboard)
- ConfirmDeleteModal with text confirmation (sendkit pattern)
- i18n for ConfirmDeleteModal internal strings (common.php)
- EmptyState component for posts index
- Exact match for "All" posts in sidebar
- Posts breadcrumbs show current status filter
- DialogFooter buttons aligned left
- API Keys page redesign with Table, DropdownMenu, EmptyState
- Extract CreateApiKeyDialog and InviteMemberDialog to components
- Remove API Keys from sidebar
- DropdownMenuItem destructive variant for Remove action
2026-03-30 14:53:42 +00:00
|
|
|
|
|
|
|
|
// Update role tests
|
|
|
|
|
test('update role requires authentication', function () {
|
2026-04-15 01:22:04 +00:00
|
|
|
$member = User::factory()->create([
|
|
|
|
|
'account_id' => $this->account->id,
|
|
|
|
|
]);
|
refactor: auth split layout, subscribe redesign, onboarding, i18n, cookie locale
Auth pages:
- Create AuthSplitLayout with animated feature slides (6 slides, 3 languages)
- All auth pages use split layout (form left, visual right)
- Add show/hide password toggle with tooltip on Register
- Legal footer only shown on Register via showLegal prop
Subscribe page:
- Redesign to match auth card pattern (centered, clean)
- Platform icons, feature checklist, dynamic trial days (trialDays - 1)
- Add "Switch workspace" link
- Full i18n (en, es, pt-BR)
Onboarding:
- Rename URLs: step1 -> role, step2 -> connect
- Add enforceStep() to prevent skipping/going back steps
- Redirect /onboarding to /onboarding/role
- Redesign Step2 with AuthSplitLayout and compact platform list
- 21 tests covering all step enforcement scenarios
Workspaces page:
- Redesign with AuthSplitLayout (list with avatars, current badge)
Language system:
- Move locale from DB to cookie (forever, unencrypted, session.domain)
- Create SetLocale middleware (sets cookie if missing, validates against config)
- Rename lang/pt-br to lang/pt-BR
- Add dayjs es locale
Other:
- Copy utils.ts from sendkit (formatNumber, formatMoney, copyToClipboard)
- ConfirmDeleteModal with text confirmation (sendkit pattern)
- i18n for ConfirmDeleteModal internal strings (common.php)
- EmptyState component for posts index
- Exact match for "All" posts in sidebar
- Posts breadcrumbs show current status filter
- DialogFooter buttons aligned left
- API Keys page redesign with Table, DropdownMenu, EmptyState
- Extract CreateApiKeyDialog and InviteMemberDialog to components
- Remove API Keys from sidebar
- DropdownMenuItem destructive variant for Remove action
2026-03-30 14:53:42 +00:00
|
|
|
$this->workspace->members()->attach($member->id, ['role' => WorkspaceRole::Member->value]);
|
|
|
|
|
|
|
|
|
|
$response = $this->put(route('app.members.update-role', $member), [
|
|
|
|
|
'role' => WorkspaceRole::Admin->value,
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$response->assertRedirect(route('login'));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('update role changes member to admin', function () {
|
2026-04-15 01:22:04 +00:00
|
|
|
$member = User::factory()->create([
|
|
|
|
|
'account_id' => $this->account->id,
|
|
|
|
|
]);
|
refactor: auth split layout, subscribe redesign, onboarding, i18n, cookie locale
Auth pages:
- Create AuthSplitLayout with animated feature slides (6 slides, 3 languages)
- All auth pages use split layout (form left, visual right)
- Add show/hide password toggle with tooltip on Register
- Legal footer only shown on Register via showLegal prop
Subscribe page:
- Redesign to match auth card pattern (centered, clean)
- Platform icons, feature checklist, dynamic trial days (trialDays - 1)
- Add "Switch workspace" link
- Full i18n (en, es, pt-BR)
Onboarding:
- Rename URLs: step1 -> role, step2 -> connect
- Add enforceStep() to prevent skipping/going back steps
- Redirect /onboarding to /onboarding/role
- Redesign Step2 with AuthSplitLayout and compact platform list
- 21 tests covering all step enforcement scenarios
Workspaces page:
- Redesign with AuthSplitLayout (list with avatars, current badge)
Language system:
- Move locale from DB to cookie (forever, unencrypted, session.domain)
- Create SetLocale middleware (sets cookie if missing, validates against config)
- Rename lang/pt-br to lang/pt-BR
- Add dayjs es locale
Other:
- Copy utils.ts from sendkit (formatNumber, formatMoney, copyToClipboard)
- ConfirmDeleteModal with text confirmation (sendkit pattern)
- i18n for ConfirmDeleteModal internal strings (common.php)
- EmptyState component for posts index
- Exact match for "All" posts in sidebar
- Posts breadcrumbs show current status filter
- DialogFooter buttons aligned left
- API Keys page redesign with Table, DropdownMenu, EmptyState
- Extract CreateApiKeyDialog and InviteMemberDialog to components
- Remove API Keys from sidebar
- DropdownMenuItem destructive variant for Remove action
2026-03-30 14:53:42 +00:00
|
|
|
$this->workspace->members()->attach($member->id, ['role' => WorkspaceRole::Member->value]);
|
|
|
|
|
|
|
|
|
|
$response = $this->actingAs($this->user)->put(route('app.members.update-role', $member), [
|
|
|
|
|
'role' => WorkspaceRole::Admin->value,
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$response->assertRedirect();
|
|
|
|
|
expect($this->workspace->members()->where('user_id', $member->id)->first()->pivot->role)->toBe(WorkspaceRole::Admin->value);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('update role changes admin to member', function () {
|
2026-04-15 01:22:04 +00:00
|
|
|
$member = User::factory()->create([
|
|
|
|
|
'account_id' => $this->account->id,
|
|
|
|
|
]);
|
refactor: auth split layout, subscribe redesign, onboarding, i18n, cookie locale
Auth pages:
- Create AuthSplitLayout with animated feature slides (6 slides, 3 languages)
- All auth pages use split layout (form left, visual right)
- Add show/hide password toggle with tooltip on Register
- Legal footer only shown on Register via showLegal prop
Subscribe page:
- Redesign to match auth card pattern (centered, clean)
- Platform icons, feature checklist, dynamic trial days (trialDays - 1)
- Add "Switch workspace" link
- Full i18n (en, es, pt-BR)
Onboarding:
- Rename URLs: step1 -> role, step2 -> connect
- Add enforceStep() to prevent skipping/going back steps
- Redirect /onboarding to /onboarding/role
- Redesign Step2 with AuthSplitLayout and compact platform list
- 21 tests covering all step enforcement scenarios
Workspaces page:
- Redesign with AuthSplitLayout (list with avatars, current badge)
Language system:
- Move locale from DB to cookie (forever, unencrypted, session.domain)
- Create SetLocale middleware (sets cookie if missing, validates against config)
- Rename lang/pt-br to lang/pt-BR
- Add dayjs es locale
Other:
- Copy utils.ts from sendkit (formatNumber, formatMoney, copyToClipboard)
- ConfirmDeleteModal with text confirmation (sendkit pattern)
- i18n for ConfirmDeleteModal internal strings (common.php)
- EmptyState component for posts index
- Exact match for "All" posts in sidebar
- Posts breadcrumbs show current status filter
- DialogFooter buttons aligned left
- API Keys page redesign with Table, DropdownMenu, EmptyState
- Extract CreateApiKeyDialog and InviteMemberDialog to components
- Remove API Keys from sidebar
- DropdownMenuItem destructive variant for Remove action
2026-03-30 14:53:42 +00:00
|
|
|
$this->workspace->members()->attach($member->id, ['role' => WorkspaceRole::Admin->value]);
|
|
|
|
|
|
|
|
|
|
$response = $this->actingAs($this->user)->put(route('app.members.update-role', $member), [
|
|
|
|
|
'role' => WorkspaceRole::Member->value,
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$response->assertRedirect();
|
|
|
|
|
expect($this->workspace->members()->where('user_id', $member->id)->first()->pivot->role)->toBe(WorkspaceRole::Member->value);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('update role fails for workspace owner', function () {
|
|
|
|
|
$response = $this->actingAs($this->user)->put(route('app.members.update-role', $this->user), [
|
|
|
|
|
'role' => WorkspaceRole::Member->value,
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$response->assertSessionHasErrors('role');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('update role fails with invalid role', function () {
|
2026-04-15 01:22:04 +00:00
|
|
|
$member = User::factory()->create([
|
|
|
|
|
'account_id' => $this->account->id,
|
|
|
|
|
]);
|
refactor: auth split layout, subscribe redesign, onboarding, i18n, cookie locale
Auth pages:
- Create AuthSplitLayout with animated feature slides (6 slides, 3 languages)
- All auth pages use split layout (form left, visual right)
- Add show/hide password toggle with tooltip on Register
- Legal footer only shown on Register via showLegal prop
Subscribe page:
- Redesign to match auth card pattern (centered, clean)
- Platform icons, feature checklist, dynamic trial days (trialDays - 1)
- Add "Switch workspace" link
- Full i18n (en, es, pt-BR)
Onboarding:
- Rename URLs: step1 -> role, step2 -> connect
- Add enforceStep() to prevent skipping/going back steps
- Redirect /onboarding to /onboarding/role
- Redesign Step2 with AuthSplitLayout and compact platform list
- 21 tests covering all step enforcement scenarios
Workspaces page:
- Redesign with AuthSplitLayout (list with avatars, current badge)
Language system:
- Move locale from DB to cookie (forever, unencrypted, session.domain)
- Create SetLocale middleware (sets cookie if missing, validates against config)
- Rename lang/pt-br to lang/pt-BR
- Add dayjs es locale
Other:
- Copy utils.ts from sendkit (formatNumber, formatMoney, copyToClipboard)
- ConfirmDeleteModal with text confirmation (sendkit pattern)
- i18n for ConfirmDeleteModal internal strings (common.php)
- EmptyState component for posts index
- Exact match for "All" posts in sidebar
- Posts breadcrumbs show current status filter
- DialogFooter buttons aligned left
- API Keys page redesign with Table, DropdownMenu, EmptyState
- Extract CreateApiKeyDialog and InviteMemberDialog to components
- Remove API Keys from sidebar
- DropdownMenuItem destructive variant for Remove action
2026-03-30 14:53:42 +00:00
|
|
|
$this->workspace->members()->attach($member->id, ['role' => WorkspaceRole::Member->value]);
|
|
|
|
|
|
|
|
|
|
$response = $this->actingAs($this->user)->put(route('app.members.update-role', $member), [
|
|
|
|
|
'role' => 'invalid',
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$response->assertSessionHasErrors('role');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('update role requires authorization', function () {
|
2026-04-15 01:22:04 +00:00
|
|
|
$member = User::factory()->create([
|
|
|
|
|
'account_id' => $this->account->id,
|
|
|
|
|
]);
|
refactor: auth split layout, subscribe redesign, onboarding, i18n, cookie locale
Auth pages:
- Create AuthSplitLayout with animated feature slides (6 slides, 3 languages)
- All auth pages use split layout (form left, visual right)
- Add show/hide password toggle with tooltip on Register
- Legal footer only shown on Register via showLegal prop
Subscribe page:
- Redesign to match auth card pattern (centered, clean)
- Platform icons, feature checklist, dynamic trial days (trialDays - 1)
- Add "Switch workspace" link
- Full i18n (en, es, pt-BR)
Onboarding:
- Rename URLs: step1 -> role, step2 -> connect
- Add enforceStep() to prevent skipping/going back steps
- Redirect /onboarding to /onboarding/role
- Redesign Step2 with AuthSplitLayout and compact platform list
- 21 tests covering all step enforcement scenarios
Workspaces page:
- Redesign with AuthSplitLayout (list with avatars, current badge)
Language system:
- Move locale from DB to cookie (forever, unencrypted, session.domain)
- Create SetLocale middleware (sets cookie if missing, validates against config)
- Rename lang/pt-br to lang/pt-BR
- Add dayjs es locale
Other:
- Copy utils.ts from sendkit (formatNumber, formatMoney, copyToClipboard)
- ConfirmDeleteModal with text confirmation (sendkit pattern)
- i18n for ConfirmDeleteModal internal strings (common.php)
- EmptyState component for posts index
- Exact match for "All" posts in sidebar
- Posts breadcrumbs show current status filter
- DialogFooter buttons aligned left
- API Keys page redesign with Table, DropdownMenu, EmptyState
- Extract CreateApiKeyDialog and InviteMemberDialog to components
- Remove API Keys from sidebar
- DropdownMenuItem destructive variant for Remove action
2026-03-30 14:53:42 +00:00
|
|
|
$this->workspace->members()->attach($member->id, ['role' => WorkspaceRole::Member->value]);
|
|
|
|
|
|
2026-04-15 01:22:04 +00:00
|
|
|
$nonAdmin = User::factory()->create([
|
|
|
|
|
'account_id' => $this->account->id,
|
|
|
|
|
]);
|
refactor: auth split layout, subscribe redesign, onboarding, i18n, cookie locale
Auth pages:
- Create AuthSplitLayout with animated feature slides (6 slides, 3 languages)
- All auth pages use split layout (form left, visual right)
- Add show/hide password toggle with tooltip on Register
- Legal footer only shown on Register via showLegal prop
Subscribe page:
- Redesign to match auth card pattern (centered, clean)
- Platform icons, feature checklist, dynamic trial days (trialDays - 1)
- Add "Switch workspace" link
- Full i18n (en, es, pt-BR)
Onboarding:
- Rename URLs: step1 -> role, step2 -> connect
- Add enforceStep() to prevent skipping/going back steps
- Redirect /onboarding to /onboarding/role
- Redesign Step2 with AuthSplitLayout and compact platform list
- 21 tests covering all step enforcement scenarios
Workspaces page:
- Redesign with AuthSplitLayout (list with avatars, current badge)
Language system:
- Move locale from DB to cookie (forever, unencrypted, session.domain)
- Create SetLocale middleware (sets cookie if missing, validates against config)
- Rename lang/pt-br to lang/pt-BR
- Add dayjs es locale
Other:
- Copy utils.ts from sendkit (formatNumber, formatMoney, copyToClipboard)
- ConfirmDeleteModal with text confirmation (sendkit pattern)
- i18n for ConfirmDeleteModal internal strings (common.php)
- EmptyState component for posts index
- Exact match for "All" posts in sidebar
- Posts breadcrumbs show current status filter
- DialogFooter buttons aligned left
- API Keys page redesign with Table, DropdownMenu, EmptyState
- Extract CreateApiKeyDialog and InviteMemberDialog to components
- Remove API Keys from sidebar
- DropdownMenuItem destructive variant for Remove action
2026-03-30 14:53:42 +00:00
|
|
|
$this->workspace->members()->attach($nonAdmin->id, ['role' => WorkspaceRole::Member->value]);
|
|
|
|
|
$nonAdmin->update(['current_workspace_id' => $this->workspace->id]);
|
|
|
|
|
|
|
|
|
|
$response = $this->actingAs($nonAdmin)->put(route('app.members.update-role', $member), [
|
|
|
|
|
'role' => WorkspaceRole::Admin->value,
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$response->assertForbidden();
|
|
|
|
|
});
|
feat: social account toggle action, API, MCP + full test coverage
- Extract ToggleSocialAccount action from SocialController
- Add API endpoints: GET /social-accounts, PUT /social-accounts/{id}/toggle
- Add MCP tools: ListSocialAccountsTool, ToggleSocialAccountTool
- Fix all MCP tools: findOrFail → find + Response::error for graceful errors
- Fix MCP tools using $request->validated() without validate() call
- Fix return types to Response|ResponseFactory for error paths
- Add SocialAccountResource is_active/status fields (no tokens exposed)
- Add 43 MCP tests covering all 18 tools (CRUD, validation, cross-workspace)
- Add API response structure tests for posts, hashtags, labels, workspace
- Add API validation tests for post create/update, api-key expiry, label color
- Add API cross-workspace delete tests for hashtags and labels
- Add app validation tests for hashtag/label update, invite fields, password
- Add auth required tests for notifications, profile delete, api-keys index
- Add media reorder validation tests
2026-03-31 04:42:39 +00:00
|
|
|
|
|
|
|
|
test('store invite validates email is required', function () {
|
|
|
|
|
$response = $this->actingAs($this->user)->post(route('app.invites.store'), []);
|
|
|
|
|
|
|
|
|
|
$response->assertSessionHasErrors('email');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('store invite validates email format', function () {
|
|
|
|
|
$response = $this->actingAs($this->user)->post(route('app.invites.store'), [
|
|
|
|
|
'email' => 'not-an-email',
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$response->assertSessionHasErrors('email');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('store invite validates role must be valid', function () {
|
|
|
|
|
$response = $this->actingAs($this->user)->post(route('app.invites.store'), [
|
|
|
|
|
'email' => 'test@example.com',
|
|
|
|
|
'role' => 'owner',
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$response->assertSessionHasErrors('role');
|
|
|
|
|
});
|