diff --git a/packages/inter-protocol/test/vaultFactory/driver.js b/packages/inter-protocol/test/vaultFactory/driver.js index 9a6d3d398fc..f7206295f8c 100644 --- a/packages/inter-protocol/test/vaultFactory/driver.js +++ b/packages/inter-protocol/test/vaultFactory/driver.js @@ -333,6 +333,10 @@ export const makeManagerDriver = async ( publicTopics.asset.subscriber, ); let managerNotification = await E(managerNotifier).getUpdateSince(); + const metricsNotifier = await makeNotifierFromSubscriber( + publicTopics.metrics.subscriber, + ); + let metricsNotification = await E(metricsNotifier).getUpdateSince(); /** @type {UserSeat} */ let currentSeat; @@ -556,6 +560,21 @@ export const makeManagerDriver = async ( } return managerNotification; }, + /** + * @param {object} [likeExpected] + * @param {AT_NEXT | number} [optSince] AT_NEXT is an alias for updateCount + * of the last update, forcing to wait for another + */ + metricsNotified: async (likeExpected, optSince) => { + metricsNotification = await E(metricsNotifier).getUpdateSince( + optSince === AT_NEXT ? metricsNotification.updateCount : optSince, + ); + trace(t, 'metrics notifier', metricsNotification); + if (likeExpected) { + t.like(metricsNotification.value, likeExpected); + } + return managerNotification; + }, checkReserveAllocation: async stableValue => { const { reserveCreatorFacet } = t.context; const reserveAllocations = await E(reserveCreatorFacet).getAllocations();