salix/services/loopback/common/methods/client/specs/confirmTransaction.spec.js

22 lines
690 B
JavaScript
Raw Normal View History

2018-09-28 13:00:12 +00:00
const app = require(`${servicesDir}/client/server/server`);
describe('Client confirmTransaction', () => {
const transactionId = 2;
afterAll(async() => {
await app.models.Client.rawSql(`
CALL hedera.tpvTransactionUndo(?)`, [transactionId]);
});
it('should call confirmTransaction() method to mark transaction as confirmed', async() => {
2018-10-02 10:03:39 +00:00
await app.models.Client.confirmTransaction(transactionId);
2018-09-28 13:00:12 +00:00
let [receipt] = await app.models.Client.rawSql(
`SELECT receiptFk
FROM hedera.tpvTransaction
WHERE id = ?`, [transactionId]);
expect(receipt.receiptFk).toBeGreaterThan(0);
});
});