merge fix/vitest-reds: clear standing i18n/sub-port vitest reds (item 10)

# Conflicts:
#	internal/web/translation/ar-EG.json
#	internal/web/translation/en-US.json
#	internal/web/translation/es-ES.json
#	internal/web/translation/fa-IR.json
#	internal/web/translation/id-ID.json
#	internal/web/translation/ja-JP.json
#	internal/web/translation/pt-BR.json
#	internal/web/translation/ru-RU.json
#	internal/web/translation/tr-TR.json
#	internal/web/translation/uk-UA.json
#	internal/web/translation/vi-VN.json
#	internal/web/translation/zh-CN.json
#	internal/web/translation/zh-TW.json
This commit is contained in:
Muse
2026-10-23 00:41:16 +00:00
14 changed files with 249 additions and 42 deletions
@@ -7,7 +7,12 @@ import SubscriptionGeneralTab from '@/pages/settings/SubscriptionGeneralTab';
import { renderWithProviders } from './test-utils';
describe('SubscriptionGeneralTab', () => {
it('keeps the stored subscription port when the field is cleared', () => {
// P7 made the subscription port optional: clearing the field applies
// subPort 0, the explicit "no port in generated links" setting (the sub
// server keeps binding the default port). This field opts out of the
// shared keep-stored-value-on-clear semantic via onNumber's onClear —
// see utils/onNumber.ts and SettingService.BuildSubURIBase.
it('applies subPort 0 (no port in generated links) when the field is cleared', () => {
const updateSetting = vi.fn();
renderWithProviders(
@@ -23,8 +28,7 @@ describe('SubscriptionGeneralTab', () => {
fireEvent.change(portInput, { target: { value: '' } });
fireEvent.blur(portInput);
expect(updateSetting).not.toHaveBeenCalled();
expect((portInput as HTMLInputElement).value).toBe('2096');
expect(updateSetting).toHaveBeenCalledWith({ subPort: 0 });
});
it('forwards typed subscription ports unchanged', () => {