Use better behavior on disconnected radio and allow deeplinking into settings. Closes #66.

This commit is contained in:
Jack Kingsman
2026-03-16 17:46:12 -07:00
parent ffb5fa51c1
commit b68bfc41d6
14 changed files with 359 additions and 56 deletions
+30
View File
@@ -8,6 +8,8 @@
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
import {
parseHashConversation,
parseHashSettingsSection,
getSettingsHash,
getMapFocusHash,
resolveChannelFromHashToken,
resolveContactFromHashToken,
@@ -147,6 +149,34 @@ describe('parseHashConversation', () => {
});
});
describe('settings URL hashes', () => {
let originalHash: string;
beforeEach(() => {
originalHash = window.location.hash;
});
afterEach(() => {
window.location.hash = originalHash;
});
it('parses a valid settings section hash', () => {
window.location.hash = '#settings/database';
expect(parseHashSettingsSection()).toBe('database');
});
it('returns null for an invalid settings section hash', () => {
window.location.hash = '#settings/not-a-section';
expect(parseHashSettingsSection()).toBeNull();
});
it('builds a stable settings hash', () => {
expect(getSettingsHash('local')).toBe('#settings/local');
});
});
describe('resolveChannelFromHashToken', () => {
const channels: Channel[] = [
{