diff --git a/packages/hardhat-plugin/test/ui/helpers/calculate-batch-display.ts b/packages/hardhat-plugin/test/ui/helpers/calculate-batch-display.ts index b6d137b08..f77aa8a1f 100644 --- a/packages/hardhat-plugin/test/ui/helpers/calculate-batch-display.ts +++ b/packages/hardhat-plugin/test/ui/helpers/calculate-batch-display.ts @@ -182,16 +182,44 @@ describe("ui - calculate batch display", () => { expectedText ); }); + + it("should render a batch when using a ledger device", () => { + const expectedText = testFormat(` + Batch #1 + Executing ExampleModule#Token... + + Ledger: Waiting for confirmation on device + `); + + assertBatchText( + [ + { + status: { + type: UiFutureStatusType.UNSTARTED, + }, + futureId: "ExampleModule#Token", + }, + ], + 3, + expectedText, + { + ledger: true, + ledgerMessage: "Waiting for confirmation on device", + } + ); + }); }); function assertBatchText( batch: UiFuture[], expectedHeight: number, - expectedText: string + expectedText: string, + extraState?: Partial ) { const { text: actualText, height } = calculateBatchDisplay({ ...exampleState, batches: [batch], + ...extraState, }); assert.equal(height, expectedHeight);