fix(marketplace): close client contract gaps
This commit is contained in:
1 parent
e4676977b9
commit
c4120dd847
9 files changed
+236
-29
No files matched your search
@@ -199,4 +199,32 @@ describe('plugin Marketplace store', () => {
|
||||
reason: 'plugin_signature_invalid: Release signature is invalid',
|
||||
});
|
||||
});
|
||||
|
||||
it('preserves the installed Beta channel when a device update fails', async () => {
|
||||
const error = Object.assign(new Error('Release is temporarily unavailable'), {
|
||||
code: 'plugin_release_unavailable',
|
||||
});
|
||||
const store = createPluginMarketplaceStore({
|
||||
installBeta: vi.fn().mockResolvedValue({
|
||||
status: 'installed',
|
||||
pluginId: 'makelore.notes',
|
||||
releaseId: 'release-beta-1',
|
||||
version: '2.0.0-beta.1',
|
||||
channel: 'beta',
|
||||
}),
|
||||
update: vi.fn().mockRejectedValue(error),
|
||||
});
|
||||
store.getState().activateAccount('account-a');
|
||||
await store.getState().installBeta('makelore.notes');
|
||||
|
||||
await expect(store.getState().update('makelore.notes')).rejects.toBe(error);
|
||||
expect(store.getState().installations['makelore.notes']).toMatchObject({
|
||||
status: 'unavailable',
|
||||
pluginId: 'makelore.notes',
|
||||
releaseId: 'release-beta-1',
|
||||
version: '2.0.0-beta.1',
|
||||
channel: 'beta',
|
||||
reason: 'plugin_release_unavailable: Release is temporarily unavailable',
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user