Skip to content

Commit

Permalink
Tests for bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
jacogr committed Oct 13, 2018
1 parent b187e9d commit 7f91a08
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions packages/api/src/promise/SubmittableExtrinsic.spec.js
@@ -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');
});
});

0 comments on commit 7f91a08

Please sign in to comment.