mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-27 16:00:09 +08:00
refactor(backend): specta ipc bindings (#8195)
* refactor(ipc): generate bindings with Specta * fix(profile): project IPC inputs to consumed fields * fix(events): remove unused refresh payloads * fix(webdav): return only consumed backup metadata * fix(network): trim unused interface metadata * fix(sysinfo): return only displayed system fields * chore(knip): check generated runtime exports * fix(proxy): confirm runtime chain updates before UI changes * fix(clipboard): propagate proxy environment copy failures * refactor(dns): remove ignored runtime patch * refactor(core): trim unused upgrade response fields * refactor(ipc): avoid redundant response copies * refactor(proxy): clarify automatic proxy query naming * chore(tests): remove added IPC regression tests * refactor(ipc): enforce typed command boundaries * chore(contract): check generated bindings before push * refactor(ipc): remove unused proxy liveness payloads
This commit is contained in:
@@ -32,6 +32,10 @@ test('committed edits retain their profile and merge with fresh saved URLs', asy
|
||||
items: [
|
||||
{
|
||||
uid: 'old-profile',
|
||||
type: null,
|
||||
name: null,
|
||||
file: null,
|
||||
updated: null,
|
||||
latency_test_urls: { untouched: 'https://example.com/' },
|
||||
},
|
||||
],
|
||||
@@ -49,7 +53,16 @@ test('committed edits retain their profile and merge with fresh saved URLs', asy
|
||||
|
||||
test('migration cannot overwrite a previously saved or cleared override', async () => {
|
||||
vi.mocked(getProfiles).mockResolvedValue({
|
||||
items: [{ uid: 'p', latency_test_urls: { A: '' } }],
|
||||
items: [
|
||||
{
|
||||
uid: 'p',
|
||||
type: null,
|
||||
name: null,
|
||||
file: null,
|
||||
updated: null,
|
||||
latency_test_urls: { A: '' },
|
||||
},
|
||||
],
|
||||
})
|
||||
await saveProfileTestUrls('p', { A: 'http://localhost/stale' }, true)
|
||||
expect(patchProfile).not.toHaveBeenCalled()
|
||||
@@ -59,14 +72,18 @@ test('pending edits survive a reload and older save acknowledgements', async ()
|
||||
vi.useFakeTimers()
|
||||
const profile = {
|
||||
uid: 'pending-profile',
|
||||
type: null,
|
||||
name: null,
|
||||
file: null,
|
||||
updated: null,
|
||||
latency_test_urls: { A: 'http://localhost/old' },
|
||||
}
|
||||
vi.mocked(getProfiles).mockResolvedValue({ items: [profile] })
|
||||
let finish!: () => void
|
||||
vi.mocked(patchProfile).mockImplementationOnce(
|
||||
() =>
|
||||
new Promise<void>((resolve) => {
|
||||
finish = resolve
|
||||
new Promise<null>((resolve) => {
|
||||
finish = () => resolve(null)
|
||||
}),
|
||||
)
|
||||
const first = commitProfileTestUrl(profile.uid, 'A', 'http://localhost/new')
|
||||
@@ -90,6 +107,10 @@ test('pending edits survive a reload and older save acknowledgements', async ()
|
||||
test('a failed save preserves the committed input across profile refreshes', async () => {
|
||||
const profile = {
|
||||
uid: 'failed-profile',
|
||||
type: null,
|
||||
name: null,
|
||||
file: null,
|
||||
updated: null,
|
||||
latency_test_urls: { A: 'http://localhost/old' },
|
||||
}
|
||||
vi.mocked(getProfiles).mockResolvedValue({ items: [profile] })
|
||||
|
||||
Reference in New Issue
Block a user