test(plugin-inventory): avoid randomized id order

This commit is contained in:
Tianyi Cui
2026-08-12 16:58:19 +08:00
parent f3bfcf33bb
commit 6e64f77030

View File

@@ -52,8 +52,9 @@ describe('PluginInventoryService', () => {
}) })
await ctx.loader.create({ name: 'cordis:active', group: true }) await ctx.loader.create({ name: 'cordis:active', group: true })
expect(inventory.list()).toEqual({ const entries = inventory.list().entries
entries: [ expect(entries).toHaveLength(3)
expect(entries).toEqual(expect.arrayContaining([
{ {
entryId: activeId, entryId: activeId,
moduleName: 'cordis:active', moduleName: 'cordis:active',
@@ -72,8 +73,7 @@ describe('PluginInventoryService', () => {
enabled: false, enabled: false,
fiberPhase: null, fiberPhase: null,
}, },
], ]))
})
await ctx.loader.update(activeId, { disabled: true }) await ctx.loader.update(activeId, { disabled: true })
expect(inventory.list().entries.find(entry => entry.entryId === activeId)).toEqual({ expect(inventory.list().entries.find(entry => entry.entryId === activeId)).toEqual({