test(plugin-inventory): avoid assuming loader sibling order

This commit is contained in:
ZiyaZhang
2026-08-12 04:23:03 -07:00
parent 5ed98d2da9
commit be693f3bc7

View File

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