trypost/tests/Unit/Settings/DeleteAccountCopyTest.php
Axi 3baf2e9c41
Add Ukrainian as a supported platform language (#219)
* Default AI content language to Ukrainian

* Keep English as the default content language

* refactor: update content language handling in workspace creation

- Changed the default content language in CreateWorkspace to inherit the app's locale instead of defaulting to English.
- Updated related tests to reflect this change, ensuring that the content language aligns with the application's current locale settings.
- Cleaned up unnecessary code in the BrandTab component for better readability.

* Add Ukrainian as a full platform UI locale.

Wire uk into languages config with complete lang/uk translations and restore ContentLanguage↔UI parity checks.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Wire Ukrainian into dayjs and locale coverage tests.

Import the uk dayjs locale with Monday week-start and cover uk/uk-UA in brand autofill and SetLocale assertions.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Harden Ukrainian UI and AI content-language coverage.

Cover generator/reviewer/humanizer/image prompts, workspace pickers, persona labels, UI locale switch, and README for uk as a first-class platform language.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Add Ukrainian Pinterest form strings after main merge.

Restore lang/uk posts.php key parity for the new pin title and destination link fields.

Co-authored-by: Cursor <cursoragent@cursor.com>

* List every supported UI language in the README.

Replace the abbreviated multi-language blurb with the full locale set from config.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Paulo Castellano <paulo@castellanos.llc>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 19:45:30 -03:00

122 lines
4.4 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
declare(strict_types=1);
use App\Enums\Workspace\ContentLanguage;
/**
* Content markers for destructive copy. Key parity across locales is covered by
* LocalizationParityTest (MorphMap-style). These markers catch stale translations
* that still have the key but omit the invited-members / conditional-delete warning.
*
* @var array<string, string>
*/
$accountDeleteInvitedMemberMarkers = [
'en' => 'invited members',
'uk' => 'запрошених учасників',
'pt-BR' => 'membros convidados',
'es' => 'miembros invitados',
'fr' => 'membres invités',
'de' => 'eingeladene Mitglieder',
'it' => 'membri invitati',
'nl' => 'uitgenodigde leden',
'pl' => 'zaproszeni członkowie',
'el' => 'προσκεκλημένα μέλη',
'ja' => '招待されたメンバー',
'ko' => '초대된 멤버',
'zh' => '受邀成员',
'ru' => 'приглашённые участники',
'tr' => 'davet edilen üyeler',
'ar' => 'الأعضاء المدعوون',
];
/**
* @var array<string, string>
*/
$workspaceDeleteConditionalMemberMarkers = [
'en' => 'without another TryPost workspace',
'uk' => 'без іншого workspace у TryPost',
'pt-BR' => 'sem outro workspace no TryPost',
'es' => 'sin otro workspace en TryPost',
'fr' => 'sans autre workspace TryPost',
'de' => 'ohne anderen TryPost-Workspace',
'it' => 'senza un altro workspace TryPost',
'nl' => 'zonder andere TryPost-workspace',
'pl' => 'bez innego workspace w TryPost',
'el' => 'χωρίς άλλο workspace στο TryPost',
'ja' => '別のTryPostワークスペースがない',
'ko' => '다른 TryPost 워크스페이스가 없는',
'zh' => '没有其他 TryPost 工作区',
'ru' => 'без другого workspace в TryPost',
'tr' => 'Başka bir TryPost workspace',
'ar' => 'مساحة عمل أخرى في TryPost',
];
test('workspace delete members warning describes conditional permanent deletion', function () {
$warning = trans_choice('settings.workspace.delete_members_warning', 1, ['count' => 1]);
expect($warning)
->toContain('lose access')
->toContain('without another TryPost workspace')
->toContain('permanently deleted')
->not->toContain('personal account');
});
test('account delete billing failure flash says nothing was deleted', function () {
$flash = __('settings.flash.delete_failed_billing');
expect($flash)
->toContain('Nothing was deleted')
->not->toContain('already removed');
});
test('account delete warning mentions invited members are permanently deleted', function () {
expect(__('settings.delete_account.warning_message'))
->toContain('invited members')
->toContain('permanently deleted');
expect(__('settings.delete_account.modal_description_password'))
->toContain('invited members')
->toContain('permanently deleted');
});
test('account delete modals mention invited members in every locale', function (string $locale, string $needle) {
expect(__('settings.delete_account.modal_description_password', [], $locale))
->toContain($needle);
expect(__('settings.delete_account.modal_description_email', ['email' => 'x@y.z'], $locale))
->toContain($needle);
expect(__('settings.delete_account.warning_message', [], $locale))
->toContain($needle);
})->with(
collect($accountDeleteInvitedMemberMarkers)
->map(fn (string $needle, string $locale): array => [$locale, $needle])
->all()
);
test('workspace delete members warning is conditional in every locale', function (string $locale, string $needle) {
$warning = trans_choice(
'settings.workspace.delete_members_warning',
2,
['count' => 2],
$locale,
);
expect($warning)->toContain($needle);
})->with(
collect($workspaceDeleteConditionalMemberMarkers)
->map(fn (string $needle, string $locale): array => [$locale, $needle])
->all()
);
test('destructive copy locale markers cover every ContentLanguage', function () use (
$accountDeleteInvitedMemberMarkers,
$workspaceDeleteConditionalMemberMarkers,
) {
expect(array_keys($accountDeleteInvitedMemberMarkers))
->toEqualCanonicalizing(ContentLanguage::values());
expect(array_keys($workspaceDeleteConditionalMemberMarkers))
->toEqualCanonicalizing(ContentLanguage::values());
});