Testing the subapplication Façade
The subapplication façade's responsibility is to create the model or collect objects and create the appropriate subapplication controller to render the fetched data. To show the contact editor, the Façade should fetch the contact by its ID and then run the ContactEditor
subapplication:
var proxyquery = require('proxyquireify')(require); var FakeApp = require('../../fakes/app'); var FakeRegion = require('../../fakes/region'); var FakeContactEditor = require('../../fakes/contactEditor'); var fakes = { '../../app': FakeApp, './contactEditor': FakeContactEditor, './contactList': {}, './contactViewer': {} }; var ContactsApp = proxyquery('../../../app/js/apps/contacts/app', fakes); describe('Contacts application facade', () => { var app; var region; function respond(request) { var fakeResponse = { name: 'John Doe', facebook: 'https://www.facebook.com/john.doe', twitter: '@john.doe', github: 'https://github.com/johndoe', google: 'https://plus.google.com...