feat(sub): refine Happ routing presets, serverDescription escaping, and auto-detect placement (#6488)

* feat(sub): refine Happ routing presets, serverDescription escaping, and auto-detect placement

* fix(sub): address PR review findings on routing parity, agent regex, and i18n
This commit is contained in:
Pejman Yousefi
2026-09-13 14:23:57 +03:30
committed by GitHub
parent c7518c4038
commit cba8f0672f
10 changed files with 306 additions and 166 deletions
@@ -69,4 +69,25 @@ describe('Happ TUN Mode select', () => {
const select = selectFor('TUN Mode');
expect(select.querySelector('.ant-select-content')?.textContent).toBe('Default');
});
it('renders Auto-Detection master switch at the top and triggers update', () => {
const updateSetting = vi.fn();
const allSetting = new AllSetting();
allSetting.subHappAutoDetect = false;
renderWithProviders(
<HappSettingsContent
allSetting={allSetting}
updateSetting={updateSetting}
isMobile={false}
remoteSourceBadge={() => null}
/>,
);
const switchBtn = document.querySelector('.ant-switch');
if (!switchBtn) throw new Error('switch not found');
fireEvent.click(switchBtn);
expect(updateSetting).toHaveBeenCalledWith({ subHappAutoDetect: true });
});
});