feat: release OpsXShell 2.1.0 native Tauri edition
This commit is contained in:
1 parent
e9a0d21758
commit
a3dba0c6ed
311 files changed
+31748
-14897
No files matched your search
@@ -35,14 +35,14 @@ describe('KeybindingStore', () => {
|
||||
expect(state.isLoaded).toBe(false)
|
||||
})
|
||||
|
||||
it('loadFromSettings 应从 electronAPI 加载自定义快捷键', async () => {
|
||||
it('loadFromSettings 应从 opsxApi 加载自定义快捷键', async () => {
|
||||
const customData = {
|
||||
[KeybindingAction.TAB_CLOSE]: 'Ctrl+Q',
|
||||
[KeybindingAction.TAB_NEW]: 'Ctrl+T',
|
||||
}
|
||||
|
||||
// Mock electronAPI 返回自定义快捷键
|
||||
vi.mocked(window.electronAPI.settingsGet).mockResolvedValueOnce({
|
||||
// Mock opsxApi 返回自定义快捷键
|
||||
vi.mocked(window.opsxApi.settingsGet).mockResolvedValueOnce({
|
||||
success: true,
|
||||
value: customData,
|
||||
})
|
||||
@@ -55,7 +55,7 @@ describe('KeybindingStore', () => {
|
||||
})
|
||||
|
||||
it('loadFromSettings 无保存数据时应使用空自定义', async () => {
|
||||
vi.mocked(window.electronAPI.settingsGet).mockResolvedValueOnce({
|
||||
vi.mocked(window.opsxApi.settingsGet).mockResolvedValueOnce({
|
||||
success: false,
|
||||
})
|
||||
|
||||
@@ -67,7 +67,7 @@ describe('KeybindingStore', () => {
|
||||
})
|
||||
|
||||
it('loadFromSettings API 报错时应安全降级', async () => {
|
||||
vi.mocked(window.electronAPI.settingsGet).mockRejectedValueOnce(new Error('API error'))
|
||||
vi.mocked(window.opsxApi.settingsGet).mockRejectedValueOnce(new Error('API error'))
|
||||
|
||||
await useKeybindingStore.getState().loadFromSettings()
|
||||
|
||||
@@ -121,7 +121,7 @@ describe('KeybindingStore', () => {
|
||||
expect(state.customKeybindings[KeybindingAction.TAB_CLOSE]).toBe('Ctrl+Q')
|
||||
|
||||
// 应调用 settingsSet 持久化
|
||||
expect(window.electronAPI.settingsSet).toHaveBeenCalledWith(
|
||||
expect(window.opsxApi.settingsSet).toHaveBeenCalledWith(
|
||||
'keybindings',
|
||||
{ [KeybindingAction.TAB_CLOSE]: 'Ctrl+Q' }
|
||||
)
|
||||
@@ -142,7 +142,7 @@ describe('KeybindingStore', () => {
|
||||
expect(state.customKeybindings[KeybindingAction.TAB_NEW]).toBe('Ctrl+T')
|
||||
|
||||
// 第二次调用应包含两个
|
||||
const lastCall = vi.mocked(window.electronAPI.settingsSet).mock.calls.at(-1)
|
||||
const lastCall = vi.mocked(window.opsxApi.settingsSet).mock.calls.at(-1)
|
||||
expect(lastCall?.[1]).toEqual({
|
||||
[KeybindingAction.TAB_CLOSE]: 'Ctrl+Q',
|
||||
[KeybindingAction.TAB_NEW]: 'Ctrl+T',
|
||||
@@ -190,7 +190,7 @@ describe('KeybindingStore', () => {
|
||||
|
||||
const state = useKeybindingStore.getState()
|
||||
expect(state.customKeybindings).toEqual({})
|
||||
expect(window.electronAPI.settingsSet).toHaveBeenCalledWith('keybindings', {})
|
||||
expect(window.opsxApi.settingsSet).toHaveBeenCalledWith('keybindings', {})
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in new issue
Block a user