mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-10 01:56:16 -08:00
test(migration): cover legacy recovery IPC contracts
This commit is contained in:
1 parent
342757dca7
commit
d2234b11c4
3 files changed
+21
-1
No files matched your search
@@ -82,6 +82,12 @@ export const dbPreloadCases: PreloadInvokeCase[] = [
|
||||
channel: 'DB_UPSERT_APP_PLAYLIST',
|
||||
forwardedArgs: [playlist],
|
||||
},
|
||||
{
|
||||
method: 'dbRecoverLegacyPlaylists',
|
||||
args: [],
|
||||
channel: 'DB_RECOVER_LEGACY_PLAYLISTS',
|
||||
forwardedArgs: [],
|
||||
},
|
||||
{
|
||||
method: 'dbMigrateAppPlaylists',
|
||||
args: [playlists],
|
||||
|
||||
@@ -73,6 +73,11 @@ export const workerIpcContractCases: WorkerIpcContractCase[] = [
|
||||
args: [playlist],
|
||||
payload: playlist,
|
||||
},
|
||||
{
|
||||
operation: 'DB_MIGRATE_APP_PLAYLISTS',
|
||||
args: [playlists],
|
||||
payload: { playlists },
|
||||
},
|
||||
{
|
||||
operation: 'DB_UPSERT_APP_PLAYLISTS',
|
||||
args: [playlists],
|
||||
|
||||
@@ -92,11 +92,20 @@ describe('database worker IPC contract', () => {
|
||||
|
||||
it('registers an IPC handler for every worker operation', () => {
|
||||
const registeredDbChannels = [...mockRegisteredHandlers.keys()]
|
||||
.filter((channel) => channel !== 'DB_CANCEL_OPERATION')
|
||||
.filter(
|
||||
(channel) =>
|
||||
![
|
||||
'DB_CANCEL_OPERATION',
|
||||
'DB_RECOVER_LEGACY_PLAYLISTS',
|
||||
].includes(channel)
|
||||
)
|
||||
.sort();
|
||||
|
||||
expect(registeredDbChannels).toEqual([...DB_WORKER_OPERATIONS].sort());
|
||||
expect(mockRegisteredHandlers.has('DB_CANCEL_OPERATION')).toBe(true);
|
||||
expect(mockRegisteredHandlers.has('DB_RECOVER_LEGACY_PLAYLISTS')).toBe(
|
||||
true
|
||||
);
|
||||
});
|
||||
|
||||
it.each(workerIpcContractCases)(
|
||||
|
||||
Reference in new issue
Block a user