Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright 2017-2018 @polkadot/api authors & contributors | ||
// This software may be modified and distributed under the terms | ||
// of the ISC license. See the LICENSE file for details. | ||
|
||
import Extrinsic from './SubmittableExtrinsic'; | ||
|
||
describe('SubmittableExtrinsic', () => { | ||
let api; | ||
|
||
beforeEach(() => { | ||
api = { | ||
rpc: { | ||
author: { | ||
submitAndWatchExtrinsic: () => Promise.resolve('submitAndWatchExtrinsic'), | ||
submitExtrinsic: () => Promise.resolve('submitExtrinsic') | ||
} | ||
} | ||
}; | ||
}); | ||
|
||
it('send calls submitAndWatchExtrinsic with statusCb', async () => { | ||
const result = await new Extrinsic(api).send(() => {}); | ||
|
||
expect(result).toEqual('submitAndWatchExtrinsic'); | ||
}); | ||
|
||
it('send calls submitExtrinsic without statusCb', async () => { | ||
const result = await new Extrinsic(api).send(); | ||
|
||
expect(result).toEqual('submitExtrinsic'); | ||
}); | ||
}); |