fix(meeting): persist transcript segment edits, restore live recording view, and route settings deep links by tab id
This commit is contained in:
parent
a8983c583a
commit
a85b24d385
15 changed files with 974 additions and 69 deletions
73
apps/desktop/tests/unit/settings-tabs-redteam-r1-29.test.ts
Normal file
73
apps/desktop/tests/unit/settings-tabs-redteam-r1-29.test.ts
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
import { describe, expect, it } from 'vitest'
|
||||
import {
|
||||
OPEN_SETTINGS_EVENT,
|
||||
SETTINGS_TAB_ORDER,
|
||||
isSettingsTabId,
|
||||
openSettings,
|
||||
readOpenSettingsTab,
|
||||
resolveSettingsTab,
|
||||
settingsTabIndex,
|
||||
} from '../../src/renderer/navigation/settingsTabs'
|
||||
import type { SettingsTabId } from '../../src/renderer/navigation/settingsTabs'
|
||||
|
||||
// 로그인 CTA 가 detail.tab='cloud' 를 보내면 AppLayout 이 그대로 숫자 인덱스 자리에 넣어
|
||||
// 아무 패널도 없는 빈 설정 창이 열리던 회귀.
|
||||
|
||||
function capture(target: EventTarget): () => SettingsTabId | null {
|
||||
let received: SettingsTabId | null = null
|
||||
target.addEventListener(OPEN_SETTINGS_EVENT, (e) => {
|
||||
received = readOpenSettingsTab(e)
|
||||
})
|
||||
return () => received
|
||||
}
|
||||
|
||||
describe('settingsTabs', () => {
|
||||
it('탭 순서는 SettingsModal 의 8개 탭과 같고 cloud 는 6번째(0 기준)다', () => {
|
||||
expect(SETTINGS_TAB_ORDER).toEqual(['general', 'audio', 'stt', 'llm', 'input', 'license', 'cloud', 'about'])
|
||||
expect(settingsTabIndex('cloud')).toBe(6)
|
||||
expect(settingsTabIndex('stt')).toBe(2)
|
||||
expect(settingsTabIndex('audio')).toBe(1)
|
||||
})
|
||||
|
||||
it('알려진 id 는 그대로, 모르는 값은 general 로 바꾼다', () => {
|
||||
expect(resolveSettingsTab('cloud')).toBe('cloud')
|
||||
expect(resolveSettingsTab('nope')).toBe('general')
|
||||
expect(resolveSettingsTab(undefined)).toBe('general')
|
||||
expect(resolveSettingsTab(null)).toBe('general')
|
||||
expect(resolveSettingsTab(99)).toBe('general')
|
||||
expect(resolveSettingsTab(1.5)).toBe('general')
|
||||
})
|
||||
|
||||
it('예전 숫자 인덱스 딥링크도 같은 탭으로 연다', () => {
|
||||
expect(resolveSettingsTab(2)).toBe('stt')
|
||||
expect(resolveSettingsTab(1)).toBe('audio')
|
||||
})
|
||||
|
||||
it('isSettingsTabId 는 문자열 id 만 통과시킨다', () => {
|
||||
expect(isSettingsTabId('about')).toBe(true)
|
||||
expect(isSettingsTabId(0)).toBe(false)
|
||||
expect(isSettingsTabId('Cloud')).toBe(false)
|
||||
})
|
||||
|
||||
it("openSettings('cloud') 를 받은 쪽은 cloud 탭을 연다", () => {
|
||||
const target = new EventTarget()
|
||||
const received = capture(target)
|
||||
openSettings('cloud', target)
|
||||
expect(received()).toBe('cloud')
|
||||
})
|
||||
|
||||
it('탭 없이 열거나 detail 없는 이벤트는 general', () => {
|
||||
const target = new EventTarget()
|
||||
const received = capture(target)
|
||||
openSettings(undefined, target)
|
||||
expect(received()).toBe('general')
|
||||
target.dispatchEvent(new Event(OPEN_SETTINGS_EVENT))
|
||||
expect(received()).toBe('general')
|
||||
})
|
||||
|
||||
it("예전 문자열 'cloud' detail 을 보내던 이벤트도 빈 창이 아니라 cloud 로 읽힌다", () => {
|
||||
const event = new CustomEvent(OPEN_SETTINGS_EVENT, { detail: { tab: 'cloud' } })
|
||||
expect(readOpenSettingsTab(event)).toBe('cloud')
|
||||
expect(readOpenSettingsTab(new CustomEvent(OPEN_SETTINGS_EVENT, { detail: { tab: 'bogus' } }))).toBe('general')
|
||||
})
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue