test(plugin-inventory): avoid assuming loader sibling order
This commit is contained in:
@@ -52,28 +52,28 @@ 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 snapshot = inventory.list()
|
||||||
entries: [
|
expect(snapshot.entries).toHaveLength(3)
|
||||||
{
|
expect(snapshot.entries).toEqual(expect.arrayContaining([
|
||||||
entryId: activeId,
|
{
|
||||||
moduleName: 'cordis:active',
|
entryId: activeId,
|
||||||
enabled: true,
|
moduleName: 'cordis:active',
|
||||||
fiberPhase: 'active',
|
enabled: true,
|
||||||
},
|
fiberPhase: 'active',
|
||||||
{
|
},
|
||||||
entryId: pendingId,
|
{
|
||||||
moduleName: 'cordis:pending',
|
entryId: pendingId,
|
||||||
enabled: true,
|
moduleName: 'cordis:pending',
|
||||||
fiberPhase: 'pending',
|
enabled: true,
|
||||||
},
|
fiberPhase: 'pending',
|
||||||
{
|
},
|
||||||
entryId: disabledId,
|
{
|
||||||
moduleName: 'cordis:not-installed',
|
entryId: disabledId,
|
||||||
enabled: false,
|
moduleName: 'cordis:not-installed',
|
||||||
fiberPhase: null,
|
enabled: false,
|
||||||
},
|
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({
|
||||||
|
|||||||
Reference in New Issue
Block a user