test(i18n,sub): clear the three standing vitest reds (item 10)
- i18n dead keys: drop 13 keys with no reference left (pages.xray.routeTester*
from the P9 feature removal, tgbot.online superseded by tgbot.messages.online,
tgbot.commands.restartSuccess/restartFailed from the rewritten restart handler)
- i18n key sets: add the P9 forwarding block (20 keys) to the 11 locales that
missed it, as English placeholders per repo convention; all 13 locales now
carry identical key sets
- subscription port test: the case predated P7 — clearing the port field is the
explicit subPort 0 (no port in generated links) opt-in via onNumber onClear,
so assert updateSetting is called with { subPort: 0 } instead of never called
No component code, UI behavior, or styles touched.
This commit is contained in:
@@ -17,7 +17,12 @@ function LocationProbe() {
|
||||
}
|
||||
|
||||
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(
|
||||
@@ -33,8 +38,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', () => {
|
||||
|
||||
Reference in New Issue
Block a user