fix(marketplace): close client contract gaps

This commit is contained in:
brother7 committed 2026-08-29 23:24:02 +08:00
1 parent e4676977b9
commit c4120dd847
9 files changed
+236 -29

No files matched your search

@@ -130,6 +130,31 @@ describe('My Plugins', () => {
expect(screen.getByText('当前频道:Beta')).toBeVisible();
});
it('keeps a failed Beta update on the explicit Beta route', () => {
const onUpdate = vi.fn();
const onInstallBeta = vi.fn();
render(<MemoryRouter><MyPluginsView
library={{ ...library, items: [library.items[0]] }}
installations={{
'makelore.notes': {
status: 'unavailable',
pluginId: 'makelore.notes',
channel: 'beta',
version: '2.0.0',
releaseId: 'beta-1',
reason: 'plugin_release_unavailable',
},
}}
state="ready" pending={{}} onRefresh={vi.fn()} onInstall={vi.fn()} onUpdate={onUpdate}
onInstallBeta={onInstallBeta} onUninstall={vi.fn()} onRemove={vi.fn()} onReacquire={vi.fn()}
/></MemoryRouter>);
fireEvent.click(screen.getByRole('button', { name: '更新 Beta灵感笔记' }));
expect(onInstallBeta).toHaveBeenCalledWith('makelore.notes');
expect(onUpdate).not.toHaveBeenCalled();
expect(screen.getByText('当前频道:Beta')).toBeVisible();
});
it('does not silently fall back to stable when the installed Beta channel has no release', () => {
render(<MemoryRouter><MyPluginsView
library={{ ...library, items: [{ ...library.items[0], betaVersion: null }] }}