Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
♻️ Fix test description
Browse files Browse the repository at this point in the history
  • Loading branch information
shuse2 committed Nov 17, 2022
1 parent ac86303 commit bc7928b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ describe('CrossChainUpdateCommand', () => {
);
});

it('should reject when first CCU contains a certificate older than LIVENESS_LIMIT / 2', async () => {
it('should reject when first CCU contains a certificate older than LIVENESS_LIMIT / 2', async () => {
await interopMod.stores.get(ChainAccountStore).set(stateStore, params.sendingChainID, {
...partnerChainAccount,
status: ChainStatus.REGISTERED,
Expand Down Expand Up @@ -381,7 +381,7 @@ it('should reject when first CCU contains a certificate older than LIVENESS_LIMI
);
});

it('should call apply for ccm and add to the inbox where receivign chain is the main chain', async () => {
it('should call apply for ccm and add to the inbox where receiving chain is the main chain', async () => {
executeContext = createTransactionContext({
chainID,
stateStore,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,7 @@ describe('CrossChainUpdateCommand', () => {
params: codec.encode(crossChainUpdateTransactionParams, params),
}),
}).createCommandVerifyContext(sidechainCCUUpdateCommand.schema);
jest
.spyOn(sidechainCCUUpdateCommand['internalMethod'], 'isLive')
.mockResolvedValue(true);
jest.spyOn(sidechainCCUUpdateCommand['internalMethod'], 'isLive').mockResolvedValue(true);
});

it('should reject when ccu params validation fails', async () => {
Expand All @@ -281,9 +279,7 @@ describe('CrossChainUpdateCommand', () => {
});

it('should return error when sending chain not live', async () => {
jest
.spyOn(sidechainCCUUpdateCommand['internalMethod'], 'isLive')
.mockResolvedValue(false);
jest.spyOn(sidechainCCUUpdateCommand['internalMethod'], 'isLive').mockResolvedValue(false);
await expect(sidechainCCUUpdateCommand.verify(verifyContext)).rejects.toThrow(
'The sending chain is not live',
);
Expand Down Expand Up @@ -347,7 +343,7 @@ describe('CrossChainUpdateCommand', () => {
);
});

it('should call apply for ccm and add to the inbox where receivign chain is the main chain', async () => {
it('should call apply for ccm and add to the inbox where receiving chain is the main chain', async () => {
executeContext = createTransactionContext({
chainID,
stateStore,
Expand All @@ -362,9 +358,9 @@ describe('CrossChainUpdateCommand', () => {

await expect(sidechainCCUUpdateCommand.execute(executeContext)).resolves.toBeUndefined();
expect(sidechainCCUUpdateCommand['apply']).toHaveBeenCalledTimes(3);
expect(
sidechainCCUUpdateCommand['internalMethod'].appendToInboxTree,
).toHaveBeenCalledTimes(3);
expect(sidechainCCUUpdateCommand['internalMethod'].appendToInboxTree).toHaveBeenCalledTimes(
3,
);
});
});
});

0 comments on commit bc7928b

Please sign in to comment.