diff --git a/src/player.ts b/src/player.ts index 01b6eac5..3876ceca 100644 --- a/src/player.ts +++ b/src/player.ts @@ -154,7 +154,7 @@ export class Player { * otherwise will be a new and different agent every time you call it */ installBundledHapp = async (bundleSource: AppBundleSource, agentPubKey?: AgentPubKey, installedAppId?: string): Promise => { - this._conductorGuard(`Player.installBundledHapp(${JSON.stringify(bundleSource)}, ${agentPubKey ? 'noAgentPubKey' : 'withAgentPubKey'})`) + this._conductorGuard(`Player.installBundledHapp(${JSON.stringify(bundleSource)}, ${agentPubKey ? 'withAgentPubKey' : 'noAgentPubKey'}, ${installedAppId || 'noInstalledAppId'})`) return this._conductor!.installBundledHapp(bundleSource, agentPubKey, installedAppId) } diff --git a/test/e2e/test-always-on.ts b/test/e2e/test-always-on.ts index 50e36d2e..0ead76ff 100644 --- a/test/e2e/test-always-on.ts +++ b/test/e2e/test-always-on.ts @@ -104,4 +104,25 @@ export default (testOrchestrator, testConfig, playersFn = (s, ...args) => s.play console.log(stats) t.end() }) + + test('test with happ bundles including installed_app_id', async t => { + t.plan(4) + const [conductorConfig, _installApps] = testConfig() + const orchestrator = await testOrchestrator() + orchestrator.registerScenario('installBundledHapp', async (s: ScenarioApi) => { + const [alice] = await playersFn(s, [conductorConfig]) + const bundlePath = path.join(__dirname, 'fixture', 'test.happ') + const installedAppId = 'test-id' + const alice_happ = await alice.installBundledHapp({ path: bundlePath }, null, installedAppId) + const hash = await alice_happ.cells[0].call('test', 'create_link') + t.equal(hash.length, 39, 'zome call succeeded') + const [appId] = await alice.adminWs().listActiveApps() + t.equal(appId, installedAppId, 'installation with correct `installed_app_id` succeeded') + }) + const stats = await orchestrator.run() + t.equal(stats.successes, 1, 'only success') + t.equal(stats.errors.length, 0, 'no errors') + console.log(stats) + t.end() + }) }