Skip to content

Commit b31bf07

Browse files
committed
Add unit tests
1 parent 0149cb2 commit b31bf07

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

packages/transaction-controller/src/TransactionController.test.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ import {
7979
GasFeeEstimateType,
8080
SimulationErrorCode,
8181
SimulationTokenStandard,
82+
TransactionContainerType,
8283
TransactionEnvelopeType,
8384
TransactionStatus,
8485
TransactionType,
@@ -7157,6 +7158,29 @@ describe('TransactionController', () => {
71577158
);
71587159
});
71597160

7161+
it('updates container types', async () => {
7162+
const { controller } = setupController({
7163+
options: {
7164+
state: {
7165+
transactions: [transactionMeta],
7166+
},
7167+
},
7168+
updateToInitialState: true,
7169+
});
7170+
7171+
const updatedTransaction = await controller.updateEditableParams(
7172+
transactionId,
7173+
{
7174+
...params,
7175+
containerTypes: [TransactionContainerType.EnforcedSimulations],
7176+
},
7177+
);
7178+
7179+
expect(updatedTransaction?.containerTypes).toStrictEqual([
7180+
TransactionContainerType.EnforcedSimulations,
7181+
]);
7182+
});
7183+
71607184
it('throws an error if no transaction metadata is found', async () => {
71617185
const { controller } = setupController();
71627186
await expect(

0 commit comments

Comments
 (0)