From 1ce7c5b5a96e08f5f407bd539110c9fa1c7392f8 Mon Sep 17 00:00:00 2001 From: Mark Vayngrib Date: Wed, 17 Jan 2018 13:25:05 -0500 Subject: [PATCH] fix: default e2e test --- lib/test/end-to-end.js | 11 +++-------- src/test/end-to-end.ts | 18 +++++++++--------- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/lib/test/end-to-end.js b/lib/test/end-to-end.js index 63a9f0c40..36ec9b308 100644 --- a/lib/test/end-to-end.js +++ b/lib/test/end-to-end.js @@ -44,7 +44,7 @@ const genIdentity = (tradle) => __awaiter(this, void 0, void 0, function* () { }; }); const baseModels = require('../models'); -const defaultProducts = ['tradle.CorporateBankAccount']; +const DEFAULT_PRODUCT = 'nl.tradle.DigitalPassport'; const SIMPLE_MESSAGE = 'tradle.SimpleMessage'; const APPLICATION = 'tradle.Application'; class Test { @@ -58,7 +58,7 @@ class Test { }); this.runEmployeeAndCustomer = wrapWithIntercept((opts = {}) => __awaiter(this, void 0, void 0, function* () { yield this._ready; - const { product = this.products[0] } = opts; + const { product = DEFAULT_PRODUCT } = opts; const { tradle, bot } = this; const [employee, customer] = yield Promise.all([ createUser({ bot, tradle, name: 'employee' }), @@ -183,7 +183,7 @@ class Test { const result = yield this.runThroughApplication({ user, relationshipManager, - product: product || this.products[0], + product, awaitCertificate: true }); const { application, conversation } = result; @@ -202,11 +202,6 @@ class Test { } } }); - conversation.forEach((item, i) => { - if (!_.isEqual(item, storedConversation.items[i])) { - debugger; - } - }); return result; }); this.approve = function (opts) { diff --git a/src/test/end-to-end.ts b/src/test/end-to-end.ts index 53acaea17..a415d4576 100644 --- a/src/test/end-to-end.ts +++ b/src/test/end-to-end.ts @@ -52,7 +52,7 @@ const genIdentity = async (tradle:Tradle) => { // }()) const baseModels = require('../models') -const defaultProducts = ['tradle.CorporateBankAccount'] +const DEFAULT_PRODUCT = 'nl.tradle.DigitalPassport' const SIMPLE_MESSAGE = 'tradle.SimpleMessage' const APPLICATION = 'tradle.Application' @@ -98,7 +98,7 @@ export class Test { public runEmployeeAndCustomer = wrapWithIntercept(async (opts={}) => { await this._ready - const { product=this.products[0] } = opts + const { product=DEFAULT_PRODUCT } = opts const { tradle, bot } = this const [ employee, @@ -211,7 +211,7 @@ export class Test { }: { user:User, relationshipManager?:User, - product?:string + product:string }) => { const { bot, models } = this @@ -272,7 +272,7 @@ export class Test { const result = await this.runThroughApplication({ user, relationshipManager, - product: product || this.products[0], + product, awaitCertificate: true }) @@ -293,11 +293,11 @@ export class Test { } }) - conversation.forEach((item, i) => { - if (!_.isEqual(item, storedConversation.items[i])) { - debugger - } - }) + // conversation.forEach((item, i) => { + // if (!_.isEqual(item, storedConversation.items[i])) { + // debugger + // } + // }) // assert.deepEqual(conversation, storedConversation.items) return result