mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-20 23:16:17 -05:00
controller: address hotspot protocol review findings
- Reset a saved protocol the newly probed device does not support instead of offering it (both UIs); a successful probe is authoritative, the saved value is only kept when probing fails. - Ignore out-of-order protocol probe responses when switching devices quickly (both UIs). - Verify the WPA2 rollback after a failed WPA3 activation; report that the hotspot may be down instead of claiming the revert succeeded. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
8687816b84
commit
2baa9cbd2e
5 changed files with 67 additions and 12 deletions
|
|
@ -208,6 +208,19 @@ describe('ControllerPage', () => {
|
|||
});
|
||||
});
|
||||
|
||||
test('a saved protocol the device does not support is reset to a supported one', async () => {
|
||||
const controllerApi = require('../../api/controller');
|
||||
controllerApi.getHotspotSettings.mockResolvedValue(
|
||||
{device: 'wlan0', ssid: 'WROLPi', password: 'wrolpi hotspot', protocol: 'wpa3'});
|
||||
controllerApi.getHotspotProtocols.mockResolvedValue({device: 'wlan0', protocols: ['wpa2']});
|
||||
renderControllerPage();
|
||||
// The stale WPA3 selection is replaced by the only protocol the device supports.
|
||||
await waitFor(() => {
|
||||
expect(screen.getAllByText('WPA2 (most compatible)').length).toBeGreaterThan(0);
|
||||
});
|
||||
expect(screen.queryByText('WPA3')).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
test('hotspot protocol dropdown only offers WPA2 on a Raspberry Pi', async () => {
|
||||
const {getHotspotProtocols} = require('../../api/controller');
|
||||
getHotspotProtocols.mockResolvedValue({device: 'wlan0', protocols: ['wpa2']});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue