From 884b2b6bb9204211140d413fb5b50f671a920b92 Mon Sep 17 00:00:00 2001 From: Matt Mazzola Date: Mon, 6 Jun 2016 17:45:33 -0700 Subject: [PATCH] Untrack tmpe2e files, rename the LICENSE and README files to be uppercase --- license.txt => LICENSE.txt | 0 Readme.md => README.md | 0 tmpe2e/protocol.e2e.spec.js | 1601 ------------------------------- tmpe2e/protocol.e2e.spec.js.map | 1 - 4 files changed, 1602 deletions(-) rename license.txt => LICENSE.txt (100%) rename Readme.md => README.md (100%) delete mode 100644 tmpe2e/protocol.e2e.spec.js delete mode 100644 tmpe2e/protocol.e2e.spec.js.map diff --git a/license.txt b/LICENSE.txt similarity index 100% rename from license.txt rename to LICENSE.txt diff --git a/Readme.md b/README.md similarity index 100% rename from Readme.md rename to README.md diff --git a/tmpe2e/protocol.e2e.spec.js b/tmpe2e/protocol.e2e.spec.js deleted file mode 100644 index d98685cd..00000000 --- a/tmpe2e/protocol.e2e.spec.js +++ /dev/null @@ -1,1601 +0,0 @@ -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) -/******/ return installedModules[moduleId].exports; -/******/ -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ exports: {}, -/******/ id: moduleId, -/******/ loaded: false -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.loaded = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(0); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - var Wpmp = __webpack_require__(1); - var Hpm = __webpack_require__(5); - var Router = __webpack_require__(9); - var mockReportEmbed_1 = __webpack_require__(13); - function createDeferred() { - var deferred = { - resolve: null, - reject: null, - promise: null - }; - var promise = new Promise(function (resolve, reject) { - deferred.resolve = resolve; - deferred.reject = reject; - }); - deferred.promise = promise; - return deferred; - } - describe('Protocol', function () { - var logMessages = (window.__karma__.config.args[0] === 'logMessages'); - var hpm; - var wpmp; - var iframe; - var iframeHpm; - var iframeLoaded; - var handler; - var spyHandler; - beforeAll(function () { - var iframeSrc = "base/e2e/utility/noop.html"; - var $iframe = $("").appendTo(document.body); - iframe = $iframe.get(0); - // Register Iframe side - iframeHpm = mockReportEmbed_1.setup(iframe.contentWindow, window, logMessages); - // Register SDK side WPMP - wpmp = new Wpmp.WindowPostMessageProxy(iframe.contentWindow, { - processTrackingProperties: { - addTrackingProperties: Hpm.HttpPostMessage.addTrackingProperties, - getTrackingProperties: Hpm.HttpPostMessage.getTrackingProperties, - }, - isErrorMessage: Hpm.HttpPostMessage.isErrorMessage, - name: 'HostProxyDefaultNoHandlers', - logMessages: logMessages - }); - hpm = new Hpm.HttpPostMessage(wpmp, { - origin: 'sdk', - 'sdk-type': 'js', - 'sdk-version': '2.0.0' - }); - var router = new Router.Router(wpmp); - router.post('/report/events/loaded', function (req, res) { - handler.handle(req); - res.send(202); - }); - router.post('/report/events/pageChanged', function (req, res) { - handler.handle(req); - res.send(202); - }); - router.post('/report/events/filterAdded', function (req, res) { - handler.handle(req); - res.send(202); - }); - router.post('/report/events/filterUpdated', function (req, res) { - handler.handle(req); - res.send(202); - }); - router.post('/report/events/filterRemoved', function (req, res) { - handler.handle(req); - res.send(202); - }); - router.post('/report/events/filtersCleared', function (req, res) { - handler.handle(req); - res.send(202); - }); - router.post('/report/events/settingsUpdated', function (req, res) { - handler.handle(req); - res.send(202); - }); - router.post('/report/events/dataSelected', function (req, res) { - handler.handle(req); - res.send(202); - }); - handler = { - test: jasmine.createSpy("testSpy").and.returnValue(true), - handle: jasmine.createSpy("handleSpy").and.callFake(function (message) { - message.handled = true; - return message; - }) - }; - spyHandler = handler; - wpmp.addHandler(handler); - var iframeLoadedDeferred = createDeferred(); - iframe.addEventListener('load', function () { - iframeLoadedDeferred.resolve(); - }); - iframeLoaded = iframeLoadedDeferred.promise; - }); - afterAll(function () { - //wpmp.stop(); - }); - beforeEach(function () { - // empty - }); - afterEach(function () { - spyHandler.test.calls.reset(); - spyHandler.handle.calls.reset(); - }); - describe('SDK-to-REPORT', function () { - describe('load', function () { - it('POST /report/load returns 400 if the request is invalid', function (done) { - // Arrange - var testData = { - load: { - reportId: "fakeId", - accessToken: "fakeToken", - options: {} - } - }; - iframeLoaded - .then(function () { - mockReportEmbed_1.spyApp.validateLoad.and.returnValue(Promise.reject(null)); - // Act - hpm.post('/report/load', testData.load) - .then(function () { - expect(false).toBe(true); - mockReportEmbed_1.spyApp.validateLoad.calls.reset(); - done(); - }) - .catch(function (response) { - // Assert - expect(mockReportEmbed_1.spyApp.validateLoad).toHaveBeenCalledWith(testData.load); - expect(mockReportEmbed_1.spyApp.load).not.toHaveBeenCalledWith(testData.load); - expect(response.statusCode).toEqual(400); - // Cleanup - mockReportEmbed_1.spyApp.validateLoad.calls.reset(); - done(); - }); - }); - }); - it('POST /report/load returns 202 if the request is valid', function (done) { - // Arrange - var testData = { - load: { - reportId: "fakeId", - accessToken: "fakeToken", - options: {} - } - }; - iframeLoaded - .then(function () { - mockReportEmbed_1.spyApp.validateLoad.and.returnValue(Promise.resolve(null)); - // Act - hpm.post('/report/load', testData.load) - .then(function (response) { - // Assert - expect(mockReportEmbed_1.spyApp.validateLoad).toHaveBeenCalledWith(testData.load); - expect(mockReportEmbed_1.spyApp.load).toHaveBeenCalledWith(testData.load); - expect(response.statusCode).toEqual(202); - // Cleanup - mockReportEmbed_1.spyApp.validateLoad.calls.reset(); - mockReportEmbed_1.spyApp.load.calls.reset(); - done(); - }); - }); - }); - it('POST /report/load causes POST /report/events/loaded', function (done) { - // Arrange - var testData = { - load: { - reportId: "fakeId", - accessToken: "fakeToken", - options: { - pageNavigationEnabled: false - } - }, - expectedEvent: { - method: 'POST', - url: '/report/events/loaded', - body: { - initiator: 'sdk' - } - } - }; - iframeLoaded - .then(function () { - mockReportEmbed_1.spyApp.load.and.returnValue(Promise.resolve(testData.load)); - // Act - hpm.post('/report/load', testData.load) - .then(function (response) { - setTimeout(function () { - // Assert - expect(mockReportEmbed_1.spyApp.validateLoad).toHaveBeenCalledWith(testData.load); - expect(mockReportEmbed_1.spyApp.load).toHaveBeenCalledWith(testData.load); - expect(spyHandler.handle).toHaveBeenCalledWith(jasmine.objectContaining(testData.expectedEvent)); - // Cleanup - mockReportEmbed_1.spyApp.validateLoad.calls.reset(); - mockReportEmbed_1.spyApp.load.calls.reset(); - done(); - }); - }); - }); - }); - }); - describe('pages', function () { - it('GET /report/pages returns 200 with body as array of pages', function (done) { - // Arrange - var testData = { - expectedPages: [ - { - name: "a" - }, - { - name: "b" - } - ] - }; - iframeLoaded - .then(function () { - mockReportEmbed_1.spyApp.getPages.and.returnValue(Promise.resolve(testData.expectedPages)); - // Act - hpm.get('/report/pages') - .then(function (response) { - // Assert - expect(mockReportEmbed_1.spyApp.getPages).toHaveBeenCalled(); - var pages = response.body; - expect(pages).toEqual(testData.expectedPages); - // Cleanup - mockReportEmbed_1.spyApp.getPages.calls.reset(); - done(); - }); - }); - }); - it('PUT /report/pages/active returns 400 if request is invalid', function (done) { - // Arrange - var testData = { - page: { - name: "fakeName", - displayName: "fakeDisplayName" - } - }; - iframeLoaded - .then(function () { - mockReportEmbed_1.spyApp.validatePage.and.returnValue(Promise.reject(null)); - // Act - hpm.put('/report/pages/active', testData.page) - .catch(function (response) { - // Assert - expect(mockReportEmbed_1.spyApp.validatePage).toHaveBeenCalledWith(testData.page); - expect(mockReportEmbed_1.spyApp.setActivePage).not.toHaveBeenCalled(); - expect(response.statusCode).toEqual(400); - // Cleanup - mockReportEmbed_1.spyApp.validatePage.calls.reset(); - mockReportEmbed_1.spyApp.setActivePage.calls.reset(); - done(); - }); - }); - }); - it('PUT /report/pages/active returns 202 if request is valid', function (done) { - // Arrange - var testData = { - page: { - name: "fakeName", - displayName: "fakeDisplayName" - } - }; - iframeLoaded - .then(function () { - mockReportEmbed_1.spyApp.validatePage.and.returnValue(Promise.resolve(null)); - // Act - hpm.put('/report/pages/active', testData.page) - .then(function (response) { - // Assert - expect(mockReportEmbed_1.spyApp.validatePage).toHaveBeenCalledWith(testData.page); - expect(mockReportEmbed_1.spyApp.setActivePage).toHaveBeenCalledWith(testData.page); - expect(response.statusCode).toEqual(202); - // Cleanup - mockReportEmbed_1.spyApp.validatePage.calls.reset(); - mockReportEmbed_1.spyApp.setActivePage.calls.reset(); - done(); - }); - }); - }); - it('PUT /report/pages/active causes POST /report/events/pageChanged', function (done) { - // Arrange - var testData = { - page: { - name: "fakeName", - displayName: "fakeDisplayName" - }, - expectedEvent: { - method: 'POST', - url: '/report/events/pageChanged', - body: jasmine.objectContaining({ - initiator: 'sdk' - }) - } - }; - iframeLoaded - .then(function () { - mockReportEmbed_1.spyApp.validatePage.and.returnValue(Promise.resolve(null)); - // Act - hpm.put('/report/pages/active', testData.page) - .then(function (response) { - // Assert - expect(mockReportEmbed_1.spyApp.validatePage).toHaveBeenCalledWith(testData.page); - expect(mockReportEmbed_1.spyApp.setActivePage).toHaveBeenCalledWith(testData.page); - expect(response.statusCode).toEqual(202); - expect(spyHandler.handle).toHaveBeenCalledWith(jasmine.objectContaining(testData.expectedEvent)); - // Cleanup - mockReportEmbed_1.spyApp.validateLoad.calls.reset(); - mockReportEmbed_1.spyApp.setActivePage.calls.reset(); - done(); - }); - }); - }); - }); - describe('filters (report level)', function () { - it('GET /report/filters returns 200 with body as array of filters', function (done) { - // Arrange - var testData = { - filters: [ - { - name: "fakeFilter1" - }, - { - name: "fakeFilter2" - } - ] - }; - iframeLoaded - .then(function () { - mockReportEmbed_1.spyApp.getFilters.and.returnValue(Promise.resolve(testData.filters)); - // Act - hpm.get('/report/filters') - .then(function (response) { - // Assert - expect(mockReportEmbed_1.spyApp.getFilters).toHaveBeenCalled(); - expect(response.statusCode).toEqual(200); - expect(response.body).toEqual(testData.filters); - // Cleanup - mockReportEmbed_1.spyApp.getFilters.calls.reset(); - done(); - }); - }); - }); - it('POST /report/filters returns 400 if request is invalid', function (done) { - // Arrange - var testData = { - filter: { - name: "fakeFilter" - } - }; - iframeLoaded - .then(function () { - mockReportEmbed_1.spyApp.validateFilter.and.returnValue(Promise.reject(null)); - // Act - hpm.post('/report/filters', testData.filter) - .catch(function (response) { - // Assert - expect(mockReportEmbed_1.spyApp.validateFilter).toHaveBeenCalledWith(testData.filter); - expect(mockReportEmbed_1.spyApp.addFilter).not.toHaveBeenCalled(); - expect(response.statusCode).toEqual(400); - // Cleanup - mockReportEmbed_1.spyApp.validateFilter.calls.reset(); - done(); - }); - }); - }); - it('POST /report/filters returns 202 if request is valid', function (done) { - // Arrange - var testData = { - filter: { - name: "fakeFilter" - } - }; - iframeLoaded - .then(function () { - mockReportEmbed_1.spyApp.validateFilter.and.returnValue(Promise.resolve(null)); - // Act - hpm.post('/report/filters', testData.filter) - .then(function (response) { - // Assert - expect(mockReportEmbed_1.spyApp.validateFilter).toHaveBeenCalledWith(testData.filter); - expect(mockReportEmbed_1.spyApp.addFilter).toHaveBeenCalledWith(testData.filter); - expect(response.statusCode).toEqual(202); - // Cleanup - mockReportEmbed_1.spyApp.validateFilter.calls.reset(); - mockReportEmbed_1.spyApp.addFilter.calls.reset(); - done(); - }); - }); - }); - it('POST /report/filters will cause POST /report/events/filterAdded', function (done) { - // Arrange - var testData = { - filter: { - name: "fakeFilter" - }, - expectedEvent: { - method: 'POST', - url: '/report/events/filterAdded' - } - }; - iframeLoaded - .then(function () { - mockReportEmbed_1.spyApp.validateFilter.and.returnValue(Promise.resolve(null)); - // Act - hpm.post('/report/filters', testData.filter) - .then(function (response) { - // Assert - expect(mockReportEmbed_1.spyApp.validateFilter).toHaveBeenCalledWith(testData.filter); - expect(mockReportEmbed_1.spyApp.addFilter).toHaveBeenCalledWith(testData.filter); - expect(response.statusCode).toEqual(202); - expect(spyHandler.handle).toHaveBeenCalledWith(jasmine.objectContaining(testData.expectedEvent)); - // Cleanup - mockReportEmbed_1.spyApp.validateFilter.calls.reset(); - mockReportEmbed_1.spyApp.addFilter.calls.reset(); - done(); - }); - }); - }); - it('PUT /report/filters returns 400 if request is invalid', function (done) { - // Arrange - var testData = { - filter: { - name: "fakeFilter" - } - }; - iframeLoaded - .then(function () { - mockReportEmbed_1.spyApp.validateFilter.and.returnValue(Promise.reject(null)); - // Act - hpm.put('/report/filters', testData.filter) - .catch(function (response) { - // Assert - expect(mockReportEmbed_1.spyApp.validateFilter).toHaveBeenCalledWith(testData.filter); - expect(mockReportEmbed_1.spyApp.updateFilter).not.toHaveBeenCalled(); - expect(response.statusCode).toEqual(400); - // Cleanup - mockReportEmbed_1.spyApp.validateFilter.calls.reset(); - done(); - }); - }); - }); - it('PUT /report/filters returns 202 if request is valid', function (done) { - // Arrange - var testData = { - filter: { - name: "fakeFilter" - } - }; - iframeLoaded - .then(function () { - mockReportEmbed_1.spyApp.validateFilter.and.returnValue(Promise.resolve(null)); - // Act - hpm.put('/report/filters', testData.filter) - .then(function (response) { - // Assert - expect(mockReportEmbed_1.spyApp.validateFilter).toHaveBeenCalledWith(testData.filter); - expect(mockReportEmbed_1.spyApp.updateFilter).toHaveBeenCalledWith(testData.filter); - expect(response.statusCode).toEqual(202); - // Cleanup - mockReportEmbed_1.spyApp.validateFilter.calls.reset(); - mockReportEmbed_1.spyApp.updateFilter.calls.reset(); - done(); - }); - }); - }); - it('PUT /report/filters will cause POST /report/events/filterUpdated', function (done) { - // Arrange - var testData = { - filter: { - name: "fakeFilter" - }, - expectedEvent: { - method: 'POST', - url: '/report/events/filterUpdated' - } - }; - iframeLoaded - .then(function () { - mockReportEmbed_1.spyApp.validateFilter.and.returnValue(Promise.resolve(null)); - // Act - hpm.put('/report/filters', testData.filter) - .then(function (response) { - // Assert - expect(mockReportEmbed_1.spyApp.validateFilter).toHaveBeenCalledWith(testData.filter); - expect(mockReportEmbed_1.spyApp.updateFilter).toHaveBeenCalledWith(testData.filter); - expect(response.statusCode).toEqual(202); - expect(spyHandler.handle).toHaveBeenCalledWith(jasmine.objectContaining(testData.expectedEvent)); - // Cleanup - mockReportEmbed_1.spyApp.validateFilter.calls.reset(); - mockReportEmbed_1.spyApp.updateFilter.calls.reset(); - done(); - }); - }); - }); - it('DELETE /report/filters returns 202 if request is valid', function (done) { - // Arrange - iframeLoaded - .then(function () { - // Act - hpm.delete('/report/filters') - .then(function (response) { - // Assert - expect(mockReportEmbed_1.spyApp.clearFilters).toHaveBeenCalled(); - expect(response.statusCode).toEqual(202); - // Cleanup - mockReportEmbed_1.spyApp.clearFilters.calls.reset(); - done(); - }); - }); - }); - it('DELETE /report/filters causes POST /report/events/filtersCleared', function (done) { - // Arrange - var testData = { - expectedEvent: { - method: 'POST', - url: '/report/events/filtersCleared' - } - }; - iframeLoaded - .then(function () { - // Act - hpm.delete('/report/filters') - .then(function (response) { - // Assert - setTimeout(function () { - expect(mockReportEmbed_1.spyApp.clearFilters).toHaveBeenCalled(); - expect(response.statusCode).toEqual(202); - expect(spyHandler.handle).toHaveBeenCalledWith(jasmine.objectContaining(testData.expectedEvent)); - // Cleanup - mockReportEmbed_1.spyApp.clearFilters.calls.reset(); - done(); - }); - }); - }); - }); - }); - describe('settings', function () { - it('PATCH /report/settings returns 400 if request is invalid', function (done) { - // Arrange - var testData = { - settings: { - filterPaneEnabled: false, - pageNavigationEnabled: false - } - }; - iframeLoaded - .then(function () { - mockReportEmbed_1.spyApp.validateSettings.and.returnValue(Promise.reject(null)); - // Act - hpm.patch('/report/settings', testData.settings) - .catch(function (response) { - // Assert - expect(mockReportEmbed_1.spyApp.validateSettings).toHaveBeenCalledWith(testData.settings); - expect(mockReportEmbed_1.spyApp.updateSettings).not.toHaveBeenCalled(); - expect(response.statusCode).toEqual(400); - // Cleanup - mockReportEmbed_1.spyApp.validateSettings.calls.reset(); - done(); - }); - }); - }); - it('PATCH /report/settings returns 202 if request is valid', function (done) { - // Arrange - var testData = { - settings: { - filterPaneEnabled: false, - pageNavigationEnabled: false - } - }; - iframeLoaded - .then(function () { - mockReportEmbed_1.spyApp.validateSettings.and.returnValue(Promise.resolve(null)); - // Act - hpm.patch('/report/settings', testData.settings) - .then(function (response) { - // Assert - expect(mockReportEmbed_1.spyApp.validateSettings).toHaveBeenCalledWith(testData.settings); - expect(mockReportEmbed_1.spyApp.updateSettings).toHaveBeenCalledWith(testData.settings); - expect(response.statusCode).toEqual(202); - // Cleanup - mockReportEmbed_1.spyApp.validateSettings.calls.reset(); - mockReportEmbed_1.spyApp.updateSettings.calls.reset(); - done(); - }); - }); - }); - it('PATCH /report/settings causes POST /report/events/settingsUpdated', function (done) { - // Arrange - var testData = { - settings: { - filterPaneEnabled: false - }, - expectedEvent: { - method: 'POST', - url: '/report/events/settingsUpdated', - body: { - initiator: 'sdk', - settings: { - filterPaneEnabled: false, - pageNavigationEnabled: false - } - } - } - }; - iframeLoaded - .then(function () { - mockReportEmbed_1.spyApp.validateSettings.and.returnValue(Promise.resolve(null)); - mockReportEmbed_1.spyApp.updateSettings.and.returnValue(Promise.resolve(testData.expectedEvent.body.settings)); - // Act - hpm.patch('/report/settings', testData.settings) - .then(function (response) { - // Assert - setTimeout(function () { - expect(mockReportEmbed_1.spyApp.validateSettings).toHaveBeenCalledWith(testData.settings); - expect(mockReportEmbed_1.spyApp.updateSettings).toHaveBeenCalledWith(testData.settings); - expect(response.statusCode).toEqual(202); - expect(spyHandler.handle).toHaveBeenCalledWith(jasmine.objectContaining(testData.expectedEvent)); - // Cleanup - mockReportEmbed_1.spyApp.validateSettings.calls.reset(); - mockReportEmbed_1.spyApp.updateSettings.calls.reset(); - done(); - }); - }); - }); - }); - }); - }); - describe('REPORT-to-SDK', function () { - describe('pages', function () { - it('POST /report/events/pageChanged when user changes page', function (done) { - // Arrange - var testData = { - event: { - initiator: 'user', - page: { - name: "fakePageName" - } - } - }; - var testExpectedRequest = { - method: 'POST', - url: '/report/events/pageChanged', - body: testData.event - }; - iframeLoaded - .then(function () { - // Act - iframeHpm.post('/report/events/pageChanged', testData.event) - .then(function (response) { - // Assert - expect(response.statusCode).toBe(202); - expect(spyHandler.handle).toHaveBeenCalledWith(jasmine.objectContaining(testExpectedRequest)); - done(); - }); - // Cleanup - }); - }); - }); - describe('filters (report level)', function () { - it('POST /report/events/filterAdded when user adds filter', function (done) { - // Arrange - var testData = { - event: { - initiator: 'user', - filter: { - name: "fakeFilter" - } - } - }; - var testExpectedRequest = { - method: 'POST', - url: '/report/events/filterAdded', - body: testData.event - }; - iframeLoaded - .then(function () { - // Act - iframeHpm.post('/report/events/filterAdded', testData.event) - .then(function (response) { - // Assert - expect(response.statusCode).toBe(202); - expect(spyHandler.handle).toHaveBeenCalledWith(jasmine.objectContaining(testExpectedRequest)); - done(); - }); - // Cleanup - }); - }); - it('POST /report/events/filterUpdated when user changes filter', function (done) { - // Arrange - var testData = { - event: { - initiator: 'user', - filter: { - name: "fakeFilter" - } - } - }; - var testExpectedRequest = { - method: 'POST', - url: '/report/events/filterUpdated', - body: testData.event - }; - iframeLoaded - .then(function () { - // Act - iframeHpm.post('/report/events/filterUpdated', testData.event) - .then(function (response) { - // Assert - expect(response.statusCode).toBe(202); - expect(spyHandler.handle).toHaveBeenCalledWith(jasmine.objectContaining(testExpectedRequest)); - done(); - }); - // Cleanup - }); - }); - it('POST /report/events/filterRemoved when user removes filter', function (done) { - // Arrange - var testData = { - event: { - initiator: 'user', - filter: { - name: "fakeFilter" - } - } - }; - var testExpectedRequest = { - method: 'POST', - url: '/report/events/filterRemoved', - body: testData.event - }; - iframeLoaded - .then(function () { - // Act - iframeHpm.post('/report/events/filterRemoved', testData.event) - .then(function (response) { - // Assert - expect(response.statusCode).toBe(202); - expect(spyHandler.handle).toHaveBeenCalledWith(jasmine.objectContaining(testExpectedRequest)); - done(); - }); - // Cleanup - }); - }); - }); - describe('settings', function () { - it('POST /report/events/settingsUpdated when user changes settings', function (done) { - // Arrange - var testData = { - event: { - initiator: 'user', - settings: { - pageNavigationEnabled: true - } - } - }; - var testExpectedRequest = { - method: 'POST', - url: '/report/events/settingsUpdated', - body: testData.event - }; - iframeLoaded - .then(function () { - // Act - iframeHpm.post('/report/events/settingsUpdated', testData.event) - .then(function (response) { - // Assert - expect(response.statusCode).toBe(202); - expect(spyHandler.handle).toHaveBeenCalledWith(jasmine.objectContaining(testExpectedRequest)); - done(); - }); - // Cleanup - }); - }); - }); - describe('data selection', function () { - it('POST /report/events/dataSelected when user selects data', function (done) { - // Arrange - var testData = { - event: { - initiator: 'user', - selection: { - data: true - } - } - }; - var testExpectedRequest = { - method: 'POST', - url: '/report/events/dataSelected', - body: testData.event - }; - iframeLoaded - .then(function () { - // Act - iframeHpm.post('/report/events/dataSelected', testData.event) - .then(function (response) { - // Assert - expect(response.statusCode).toBe(202); - expect(spyHandler.handle).toHaveBeenCalledWith(jasmine.objectContaining(testExpectedRequest)); - done(); - }); - // Cleanup - }); - }); - }); - }); - }); - - -/***/ }, -/* 1 */ -/***/ function(module, exports, __webpack_require__) { - - var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (factory) { - if (typeof module === 'object' && typeof module.exports === 'object') { - var v = factory(__webpack_require__(2), exports); if (v !== undefined) module.exports = v; - } - else if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } - })(function (require, exports) { - "use strict"; - var WindowPostMessageProxy = (function () { - function WindowPostMessageProxy(contentWindow, options) { - var _this = this; - if (options === void 0) { options = { - processTrackingProperties: { - addTrackingProperties: WindowPostMessageProxy.defaultAddTrackingProperties, - getTrackingProperties: WindowPostMessageProxy.defaultGetTrackingProperties - }, - isErrorMessage: WindowPostMessageProxy.defaultIsErrorMessage, - receiveWindow: window, - name: WindowPostMessageProxy.createRandomString() - }; } - this.pendingRequestPromises = {}; - // save contentWindow - this.contentWindow = contentWindow; - // save options with defaults - this.addTrackingProperties = (options.processTrackingProperties && options.processTrackingProperties.addTrackingProperties) || WindowPostMessageProxy.defaultAddTrackingProperties; - this.getTrackingProperties = (options.processTrackingProperties && options.processTrackingProperties.getTrackingProperties) || WindowPostMessageProxy.defaultGetTrackingProperties; - this.isErrorMessage = options.isErrorMessage || WindowPostMessageProxy.defaultIsErrorMessage; - this.receiveWindow = options.receiveWindow || window; - this.name = options.name || WindowPostMessageProxy.createRandomString(); - this.logMessages = options.logMessages || false; - // Initialize - this.handlers = []; - this.windowMessageHandler = function (event) { return _this.onMessageReceived(event); }; - this.start(); - } - // Static - WindowPostMessageProxy.defaultAddTrackingProperties = function (message, trackingProperties) { - message[WindowPostMessageProxy.messagePropertyName] = trackingProperties; - return message; - }; - WindowPostMessageProxy.defaultGetTrackingProperties = function (message) { - return message[WindowPostMessageProxy.messagePropertyName]; - }; - WindowPostMessageProxy.defaultIsErrorMessage = function (message) { - return !!message.error; - }; - /** - * Adds handler. - * If the first handler whose test method returns true will handle the message and provide a response. - */ - WindowPostMessageProxy.prototype.addHandler = function (handler) { - this.handlers.push(handler); - }; - /** - * Removes handler. - * The reference must match the original object that was provided when adding the handler. - */ - WindowPostMessageProxy.prototype.removeHandler = function (handler) { - var handlerIndex = this.handlers.indexOf(handler); - if (handlerIndex == -1) { - throw new Error("You attempted to remove a handler but no matching handler was found."); - } - this.handlers.splice(handlerIndex, 1); - }; - /** - * Start listening to message events. - */ - WindowPostMessageProxy.prototype.start = function () { - this.receiveWindow.addEventListener('message', this.windowMessageHandler); - }; - /** - * Stops listening to message events. - */ - WindowPostMessageProxy.prototype.stop = function () { - this.receiveWindow.removeEventListener('message', this.windowMessageHandler); - }; - /** - * Post message to target window with tracking properties added and save deferred object referenced by tracking id. - */ - WindowPostMessageProxy.prototype.postMessage = function (message) { - // Add tracking properties to indicate message came from this proxy - var trackingProperties = { id: WindowPostMessageProxy.createRandomString() }; - this.addTrackingProperties(message, trackingProperties); - if (this.logMessages) { - console.log(this.name + " Posting message:"); - console.log(JSON.stringify(message, null, ' ')); - } - this.contentWindow.postMessage(message, "*"); - var deferred = WindowPostMessageProxy.createDeferred(); - this.pendingRequestPromises[trackingProperties.id] = deferred; - return deferred.promise; - }; - /** - * Send response message to target window. - * Response messages re-use tracking properties from a previous request message. - */ - WindowPostMessageProxy.prototype.sendResponse = function (message, trackingProperties) { - this.addTrackingProperties(message, trackingProperties); - if (this.logMessages) { - console.log(this.name + " Sending response:"); - console.log(JSON.stringify(message, null, ' ')); - } - this.contentWindow.postMessage(message, "*"); - }; - /** - * Message handler. - */ - WindowPostMessageProxy.prototype.onMessageReceived = function (event) { - var _this = this; - if (this.logMessages) { - console.log(this.name + " Received message:"); - console.log("type: " + event.type); - console.log(JSON.stringify(event.data, null, ' ')); - } - var message = event.data; - var trackingProperties = this.getTrackingProperties(message); - // If this proxy instance could not find tracking properties then disregard message since we can't reliably respond - if (!trackingProperties) { - return; - } - var deferred = this.pendingRequestPromises[trackingProperties.id]; - // If message does not have a known ID, treat it as a request - // Otherwise, treat message as response - if (!deferred) { - var handled = this.handlers.some(function (handler) { - if (handler.test(message)) { - Promise.resolve(handler.handle(message)) - .then(function (responseMessage) { - _this.sendResponse(responseMessage, trackingProperties); - }); - return true; - } - }); - /** - * TODO: Consider returning an error message if nothing handled the message. - * In the case of the Report receiving messages all of them should be handled, - * however, in the case of the SDK receiving messages it's likely it won't register handlers - * for all events. Perhaps make this an option at construction time. - */ - if (!handled) { - console.warn("Proxy(" + this.name + ") did not handle message. Handlers: " + this.handlers.length + " Message: " + JSON.stringify(message, null, '') + "."); - } - } - else { - /** - * If error message reject promise, - * Otherwise, resolve promise - */ - if (this.isErrorMessage(message)) { - deferred.reject(message); - } - else { - deferred.resolve(message); - } - // TODO: Move to .finally clause up where promise is created for better maitenance like original proxy code. - delete this.pendingRequestPromises[trackingProperties.id]; - } - }; - /** - * Utility to create a deferred object. - */ - // TODO: Look to use RSVP library instead of doing this manually. - // From what I searched RSVP would work better because it has .finally and .deferred; however, it doesn't have Typings information. - WindowPostMessageProxy.createDeferred = function () { - var deferred = { - resolve: null, - reject: null, - promise: null - }; - var promise = new Promise(function (resolve, reject) { - deferred.resolve = resolve; - deferred.reject = reject; - }); - deferred.promise = promise; - return deferred; - }; - /** - * Utility to generate random sequence of characters used as tracking id for promises. - */ - WindowPostMessageProxy.createRandomString = function () { - return (Math.random() + 1).toString(36).substring(7); - }; - WindowPostMessageProxy.messagePropertyName = "windowPostMessageProxy"; - return WindowPostMessageProxy; - }()); - exports.WindowPostMessageProxy = WindowPostMessageProxy; - }); - //# sourceMappingURL=windowPostMessageProxy.js.map - -/***/ }, -/* 2 */ -/***/ function(module, exports, __webpack_require__) { - - var map = { - "./windowPostMessageProxy": 1, - "./windowPostMessageProxy.js": 1 - }; - function webpackContext(req) { - return __webpack_require__(webpackContextResolve(req)); - }; - function webpackContextResolve(req) { - return map[req] || (function() { throw new Error("Cannot find module '" + req + "'.") }()); - }; - webpackContext.keys = function webpackContextKeys() { - return Object.keys(map); - }; - webpackContext.resolve = webpackContextResolve; - module.exports = webpackContext; - webpackContext.id = 2; - - -/***/ }, -/* 3 */, -/* 4 */, -/* 5 */ -/***/ function(module, exports, __webpack_require__) { - - var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (factory) { - if (typeof module === 'object' && typeof module.exports === 'object') { - var v = factory(__webpack_require__(6), exports); if (v !== undefined) module.exports = v; - } - else if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } - })(function (require, exports) { - "use strict"; - var HttpPostMessage = (function () { - function HttpPostMessage(windowPostMessageProxy, defaultHeaders) { - if (defaultHeaders === void 0) { defaultHeaders = {}; } - this.defaultHeaders = defaultHeaders; - this.windowPostMessageProxy = windowPostMessageProxy; - } - // TODO: I the responsibility of knowing how to configure windowPostMessageProxy should - // live in this class, but then we have to have hard dependency for things like ITrackingProperties - HttpPostMessage.addTrackingProperties = function (message, trackingProperties) { - message.headers = message.headers || {}; - message.headers.id = trackingProperties.id; - return message; - }; - HttpPostMessage.getTrackingProperties = function (message) { - return { - id: message.headers.id - }; - }; - HttpPostMessage.isErrorMessage = function (message) { - return !(200 <= message.statusCode && message.statusCode < 300); - }; - HttpPostMessage.prototype.get = function (url, headers) { - if (headers === void 0) { headers = {}; } - return this.send({ - method: "GET", - url: url, - headers: headers - }); - }; - HttpPostMessage.prototype.post = function (url, body, headers) { - if (headers === void 0) { headers = {}; } - return this.send({ - method: "POST", - url: url, - headers: headers, - body: body - }); - }; - HttpPostMessage.prototype.put = function (url, body, headers) { - if (headers === void 0) { headers = {}; } - return this.send({ - method: "PUT", - url: url, - headers: headers, - body: body - }); - }; - HttpPostMessage.prototype.patch = function (url, body, headers) { - if (headers === void 0) { headers = {}; } - return this.send({ - method: "PATCH", - url: url, - headers: headers, - body: body - }); - }; - HttpPostMessage.prototype.delete = function (url, headers) { - if (headers === void 0) { headers = {}; } - return this.send({ - method: "DELETE", - url: url, - headers: headers - }); - }; - HttpPostMessage.prototype.send = function (request) { - this.assign(request.headers, this.defaultHeaders); - return this.windowPostMessageProxy.postMessage(request); - }; - /** - * Object.assign() polyfill - * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign - */ - HttpPostMessage.prototype.assign = function (target) { - var sources = []; - for (var _i = 1; _i < arguments.length; _i++) { - sources[_i - 1] = arguments[_i]; - } - if (target === undefined || target === null) { - throw new TypeError('Cannot convert undefined or null to object'); - } - var output = Object(target); - sources.forEach(function (source) { - if (source !== undefined && source !== null) { - for (var nextKey in source) { - if (Object.prototype.hasOwnProperty.call(source, nextKey)) { - output[nextKey] = source[nextKey]; - } - } - } - }); - return output; - }; - return HttpPostMessage; - }()); - exports.HttpPostMessage = HttpPostMessage; - }); - //# sourceMappingURL=httpPostMessage.js.map - -/***/ }, -/* 6 */ -/***/ function(module, exports, __webpack_require__) { - - var map = { - "./httpPostMessage": 5, - "./httpPostMessage.js": 5 - }; - function webpackContext(req) { - return __webpack_require__(webpackContextResolve(req)); - }; - function webpackContextResolve(req) { - return map[req] || (function() { throw new Error("Cannot find module '" + req + "'.") }()); - }; - webpackContext.keys = function webpackContextKeys() { - return Object.keys(map); - }; - webpackContext.resolve = webpackContextResolve; - module.exports = webpackContext; - webpackContext.id = 6; - - -/***/ }, -/* 7 */, -/* 8 */, -/* 9 */ -/***/ function(module, exports, __webpack_require__) { - - var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (factory) { - if (typeof module === 'object' && typeof module.exports === 'object') { - var v = factory(__webpack_require__(10), exports); if (v !== undefined) module.exports = v; - } - else if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } - })(function (require, exports) { - "use strict"; - var Router = (function () { - function Router(handlers) { - this.handlers = handlers; - } - Router.prototype.get = function (url, handler) { - this.registerHandler("GET", url, handler); - return this; - }; - Router.prototype.patch = function (url, handler) { - this.registerHandler("PATCH", url, handler); - return this; - }; - Router.prototype.post = function (url, handler) { - this.registerHandler("POST", url, handler); - return this; - }; - Router.prototype.put = function (url, handler) { - this.registerHandler("PUT", url, handler); - return this; - }; - Router.prototype.delete = function (url, handler) { - this.registerHandler("DELETE", url, handler); - return this; - }; - Router.prototype.registerHandler = function (method, url, handler) { - var internalHandler = { - test: function (request) { - return (request.method === method - && request.url === url); - }, - handle: function (request) { - var response = new Response(); - return Promise.resolve(handler(request, response)) - .then(function (x) { return response; }); - } - }; - this.handlers.addHandler(internalHandler); - }; - return Router; - }()); - exports.Router = Router; - var Response = (function () { - function Response() { - this.statusCode = 200; - this.headers = {}; - this.body = null; - } - Response.prototype.send = function (statusCode, body) { - this.statusCode = statusCode; - this.body = body; - }; - return Response; - }()); - exports.Response = Response; - }); - //# sourceMappingURL=router.js.map - -/***/ }, -/* 10 */ -/***/ function(module, exports, __webpack_require__) { - - var map = { - "./router": 9, - "./router.js": 9 - }; - function webpackContext(req) { - return __webpack_require__(webpackContextResolve(req)); - }; - function webpackContextResolve(req) { - return map[req] || (function() { throw new Error("Cannot find module '" + req + "'.") }()); - }; - webpackContext.keys = function webpackContextKeys() { - return Object.keys(map); - }; - webpackContext.resolve = webpackContextResolve; - module.exports = webpackContext; - webpackContext.id = 10; - - -/***/ }, -/* 11 */, -/* 12 */, -/* 13 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - var Wpmp = __webpack_require__(1); - var Hpm = __webpack_require__(5); - var Router = __webpack_require__(9); - var mockApp_1 = __webpack_require__(14); - exports.spyApp = mockApp_1.mockAppSpyObj; - function setup(iframeContentWindow, parentWindow, logMessages) { - var parent = parentWindow || iframeContentWindow.parent; - var wpmp = new Wpmp.WindowPostMessageProxy(parentWindow, { - processTrackingProperties: { - addTrackingProperties: Hpm.HttpPostMessage.addTrackingProperties, - getTrackingProperties: Hpm.HttpPostMessage.getTrackingProperties, - }, - isErrorMessage: Hpm.HttpPostMessage.isErrorMessage, - receiveWindow: iframeContentWindow, - name: 'MockAppWindowPostMessageProxy', - logMessages: false - }); - var hpm = new Hpm.HttpPostMessage(wpmp, { - origin: 'powerbi' - }); - var router = new Router.Router(wpmp); - var app = mockApp_1.mockApp; - /** - * Phase 1 - */ - router.post('/report/load', function (req, res) { - var loadConfig = req.body; - return app.validateLoad(loadConfig) - .then(function () { - app.load(loadConfig) - .then(function () { - var initiator = "sdk"; - hpm.post('/report/events/loaded', { - initiator: initiator - }); - }, function (error) { - hpm.post('/report/events/error', error); - }); - res.send(202); - }, function (error) { - res.send(400, error); - }); - }); - router.get('/report/pages', function (req, res) { - return app.getPages() - .then(function (pages) { - res.send(200, pages); - }); - }); - router.put('/report/pages/active', function (req, res) { - var page = req.body; - return app.validatePage(page) - .then(function () { - app.setActivePage(page) - .then(function (page) { - var initiator = "sdk"; - hpm.post('/report/events/pageChanged', { - initiator: initiator, - page: page - }); - }, function (error) { - hpm.post('/report/events/error', error); - }); - res.send(202); - }, function (error) { - res.send(400, error); - }); - }); - /** - * Phase 2 - */ - router.get('/report/filters', function (req, res) { - return app.getFilters() - .then(function (filters) { - res.send(200, filters); - }); - }); - router.post('/report/filters', function (req, res) { - var filter = req.body; - return app.validateFilter(filter) - .then(function () { - app.addFilter(filter) - .then(function (filter) { - var initiator = "sdk"; - hpm.post('/report/events/filterAdded', { - initiator: initiator, - filter: filter - }); - }, function (error) { - hpm.post('/report/events/error', error); - }); - res.send(202); - }, function (error) { - res.send(400, error); - }); - }); - router.put('/report/filters', function (req, res) { - var filter = req.body; - return app.validateFilter(filter) - .then(function () { - app.updateFilter(filter) - .then(function (filter) { - var initiator = "sdk"; - hpm.post('/report/events/filterUpdated', { - initiator: initiator, - filter: filter - }); - }, function (error) { - hpm.post('/report/events/error', error); - }); - res.send(202); - }, function (error) { - res.send(400, error); - }); - }); - router.delete('/report/filters', function (req, res) { - app.clearFilters() - .then(function (filter) { - var initiator = "sdk"; - hpm.post('/report/events/filtersCleared', { - initiator: initiator, - filter: filter - }); - }, function (error) { - hpm.post('/report/events/error', error); - }); - res.send(202); - }); - /** - * Phase 3 - */ - /** - * TODO: Investigate the api for getting setting filters at targets. - * Currently we are transforming the target into url parameters and then back out of url parameters - * although this is more correct for use of HTTP, it might be easier to just keep it as an object in the body. - */ - router.get('/report/pages/:pageName/filters', function (req, res) { - var pageName = req.params.pageName; - var target = { - type: "page", - name: pageName - }; - return app.getFilters(target) - .then(function (filters) { - res.send(200, filters); - }); - }); - router.post('/report/pages/:pageName/filters', function (req, res) { - var filter = req.body; - var pageName = req.params.pageName; - var target = { - type: "page", - name: pageName - }; - return app.validateFilter(filter) - .then(function () { - app.addFilter(filter, target) - .then(function (filter) { - var initiator = "sdk"; - hpm.post("/report/pages/" + pageName + "/events/filterAdded", { - initiator: initiator, - filter: filter - }); - }, function (error) { - hpm.post('/report/events/error', error); - }); - res.send(202); - }, function (errors) { - res.send(400, errors); - }); - }); - router.put('/report/pages/:pageName/filters', function (req, res) { - var filter = req.body; - var pageName = req.params.pageName; - var target = { - type: "page", - name: pageName - }; - return app.validateFilter(filter) - .then(function () { - app.updateFilter(filter, target) - .then(function (filter) { - var initiator = "sdk"; - hpm.post("/report/pages/" + pageName + "/events/filterUpdated", { - initiator: initiator, - filter: filter - }); - }, function (error) { - hpm.post('/report/events/error', error); - }); - res.send(202); - }, function (errors) { - res.send(400, errors); - }); - }); - router.put('/report/filters', function (req, res) { - var filter = req.body; - return app.validateFilter(filter) - .then(function () { - app.updateFilter(filter) - .then(function (filter) { - var initiator = "sdk"; - hpm.post("/report/events/filterUpdated", { - initiator: initiator, - filter: filter - }); - }, function (error) { - hpm.post('/report/events/error', error); - }); - res.send(202); - }, function (errors) { - res.send(400, errors); - }); - }); - router.patch('/report/settings', function (req, res) { - var settings = req.body; - return app.validateSettings(settings) - .then(function () { - app.updateSettings(settings) - .then(function (updatedSettings) { - var initiator = "sdk"; - hpm.post("/report/events/settingsUpdated", { - initiator: initiator, - settings: updatedSettings - }); - }, function (error) { - hpm.post('/report/events/error', error); - }); - res.send(202); - }, function (errors) { - res.send(400, errors); - }); - }); - /** - * Phase 4 - */ - // No work for router - /** - * Phase 5 - */ - router.get('/report/data', function (req, res) { - var target = { - type: 'visual', - visual: "xyz?" - }; - return app.exportData(target) - .then(function (data) { - res.send(200, data); - }); - }); - return hpm; - } - exports.setup = setup; - - -/***/ }, -/* 14 */ -/***/ function(module, exports) { - - /** - * These are the methods that should be implemented and exposed in the PowerBI angular application which can be invoked from the ReportEmbed iframe. - */ - "use strict"; - exports.mockAppSpyObj = { - // Load - load: jasmine.createSpy("load").and.returnValue(Promise.resolve(null)), - validateLoad: jasmine.createSpy("validateLoad").and.returnValue(Promise.resolve(null)), - // Settings - updateSettings: jasmine.createSpy("updateSettings").and.returnValue(Promise.resolve(null)), - validateSettings: jasmine.createSpy("validateSettings").and.returnValue(Promise.resolve(null)), - // Pages - getPages: jasmine.createSpy("getPages").and.returnValue(Promise.resolve(null)), - setActivePage: jasmine.createSpy("setActivePage").and.returnValue(Promise.resolve(null)), - togglePageNavigation: jasmine.createSpy("togglePageNavigation").and.returnValue(Promise.resolve(null)), - validatePage: jasmine.createSpy("validatePage").and.returnValue(Promise.resolve(null)), - // Filters - validateFilter: jasmine.createSpy("validateFilter").and.returnValue(Promise.resolve(null)), - validateTarget: jasmine.createSpy("validateTarget").and.returnValue(Promise.resolve(null)), - getFilters: jasmine.createSpy("getFilters").and.returnValue(Promise.resolve(null)), - addFilter: jasmine.createSpy("addFilter").and.returnValue(Promise.resolve(null)), - updateFilter: jasmine.createSpy("updateFilter").and.returnValue(Promise.resolve(null)), - removeFilter: jasmine.createSpy("removeFilter").and.returnValue(Promise.resolve(null)), - clearFilters: jasmine.createSpy("clearFilters").and.returnValue(Promise.resolve(null)), - toggleFilterPane: jasmine.createSpy("toggleFilterPane").and.returnValue(Promise.resolve(null)), - // Other - exportData: jasmine.createSpy("exportData").and.returnValue(Promise.resolve(null)) - }; - exports.mockApp = exports.mockAppSpyObj; - - -/***/ } -/******/ ]); -//# sourceMappingURL=protocol.e2e.spec.js.map \ No newline at end of file diff --git a/tmpe2e/protocol.e2e.spec.js.map b/tmpe2e/protocol.e2e.spec.js.map deleted file mode 100644 index 151708c5..00000000 --- a/tmpe2e/protocol.e2e.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap f66629e539b72ebd532d","webpack:///./e2e/protocol.e2e.spec.ts","webpack:///./~/window-post-message-proxy/dist/windowPostMessageProxy.js","webpack:///./~/window-post-message-proxy/dist ^\\.\\/.*$","webpack:///./~/http-post-message/dist/httpPostMessage.js","webpack:///./~/http-post-message/dist ^\\.\\/.*$","webpack:///./~/powerbi-router/dist/router.js","webpack:///./~/powerbi-router/dist ^\\.\\/.*$","webpack:///./e2e/utility/mockReportEmbed.ts","webpack:///./e2e/utility/mockApp.ts"],"names":[],"mappings":";AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;ACtCA,KAAY,IAAI,uBAAM,CAA2B,CAAC;AAClD,KAAY,GAAG,uBAAM,CAAmB,CAAC;A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M;yBACjB,SAAS,EAAE;6BACT,IAAI,EAAE,IAAI;0BACX;sBACF;kBACF,CAAC;iBACF,IAAM,mBAAmB,GAAG;qBAC1B,MAAM,EAAE,MAAM;qBACd,GAAG,EAAE,6BAA6B;qBAClC,IAAI,EAAE,QAAQ,CAAC,KAAK;kBACrB,CAAC;iBAEF,YAAY;sBACT,IAAI,CAAC;qBAER,MAAM;qBACF,SAAS,CAAC,IAAI,CAAC,6BAA6B,EAAE,QAAQ,CAAC,KAAK,CAAC;0BAC1D,IAAI,CAAC,UAAC,QAAuB;yBACpC,SAAS;yBACD,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;yBACtC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,oBAAoB,CAAC,OAAO,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,CAAC,CAAC;yBAC9F,IAAI,EAAE,CAAC;qBACT,CAAC,CAAC,CAAC;qBAET,UAAU;iBACR,CAAC,CAAC,CAAC;aACP,CAAC,CAAC,CAAC;SACL,CAAC,CAAC,CAAC;KACL,CAAC,CAAC,CAAC;AACL,EAAC,CAAC,CAAC;;;;;;;ACr5BH;AACA;AACA,0DAA0C;AAC1C;AACA;AACA;AACA;AACA,EAAC;AACD;AACA;AACA;AACA;AACA,sCAAqC;AACrC;AACA;AACA;AACA,kBAAiB;AACjB;AACA;AACA;AACA,eAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA0D,uCAAuC;AACjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAAyB;AACzB;AACA;AACA,kBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8FAA6F;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA,EAAC;AACD,mD;;;;;;AC5LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAiC,uDAAuD;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACfA;AACA;AACA,0DAA0C;AAC1C;AACA;AACA;AACA;AACA,EAAC;AACD;AACA;AACA;AACA,6CAA4C,qBAAqB;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAqC,cAAc;AACnD;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA,sCAAqC,cAAc;AACnD;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA,sCAAqC,cAAc;AACnD;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA,sCAAqC,cAAc;AACnD;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA,sCAAqC,cAAc;AACnD;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA4B,uBAAuB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA,MAAK;AACL;AACA,EAAC;AACD,4C;;;;;;ACzGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAiC,uDAAuD;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACfA;AACA;AACA,2DAA0C;AAC1C;AACA;AACA;AACA;AACA,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB;AACjB;AACA;AACA;AACA,6CAA4C,iBAAiB,EAAE;AAC/D;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA,EAAC;AACD,mC;;;;;;AChEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAiC,uDAAuD;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;ACfA,KAAY,IAAI,uBAAM,CAA2B,CAAC;AAClD,KAAY,GAAG,uBAAM,CAAmB,CAAC;AACzC,KAAY,MAAM,uBAAM,CAAgB,CAAC;AACzC,qCAAuC,EAAW,CAAC;AAEtC,eAAM,GAAG,uBAAa,CAAC;AAEpC,gBAAsB,mBAA2B,EAAE,YAAoB,EAAE,WAAoB;KAC3F,IAAM,MAAM,GAAG,YAAY,IAAI,mBAAmB,CAAC,MAAM,CAAC;KAC1D,IAAM,IAAI,GAAG,IAAI,IAAI,CAAC,sBAAsB,CAAC,YAAY,EAAE;SACzD,yBAAyB,EAAE;aACvB,qBAAqB,EAAE,GAAG,CAAC,eAAe,CAAC,qBAAqB;aAChE,qBAAqB,EAAE,GAAG,CAAC,eAAe,CAAC,qBAAqB;UACnE;SACD,cA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OAAO,CAAC,IAAI,CAAC,CAAC;KACtF,gBAAgB,EAAE,OAAO,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;KAC9F,QAAQ;KACR,UAAU,EAAE,OAAO,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;EACnF,CAAC;AAEW,gBAAO,GAAS,qBAAa,CAAC","file":"protocol.e2e.spec.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap f66629e539b72ebd532d\n **/","import * as Wpmp from 'window-post-message-proxy';\r\nimport * as Hpm from 'http-post-message';\r\nimport * as Router from 'powerbi-router';\r\nimport { spyApp, setup } from './utility/mockReportEmbed';\r\n\r\nfunction createDeferred() {\r\n const deferred:any = {\r\n resolve: null,\r\n reject: null,\r\n promise: null\r\n };\r\n \r\n const promise = new Promise((resolve: () => void, reject: () => void) => {\r\n deferred.resolve = resolve;\r\n deferred.reject = reject;\r\n });\r\n \r\n deferred.promise = promise;\r\n \r\n return deferred;\r\n}\r\n\r\ndeclare global {\r\n interface Window {\r\n __karma__: any;\r\n }\r\n}\r\n\r\ndescribe('Protocol', function () {\r\n let logMessages = (window.__karma__.config.args[0] === 'logMessages');\r\n let hpm: Hpm.HttpPostMessage;\r\n let wpmp: Wpmp.WindowPostMessageProxy;\r\n let iframe: HTMLIFrameElement;\r\n let iframeHpm: Hpm.HttpPostMessage;\r\n let iframeLoaded: Promise;\r\n \r\n let handler: Wpmp.IMessageHandler;\r\n let spyHandler: {\r\n test: jasmine.Spy,\r\n handle: jasmine.Spy\r\n };\r\n \r\n beforeAll(function () {\r\n const iframeSrc = \"base/e2e/utility/noop.html\";\r\n const $iframe = $(``).appendTo(document.body);\r\n iframe = $iframe.get(0);\r\n \r\n // Register Iframe side\r\n iframeHpm = setup(iframe.contentWindow, window, logMessages);\r\n \r\n // Register SDK side WPMP\r\n wpmp = new Wpmp.WindowPostMessageProxy(iframe.contentWindow, {\r\n processTrackingProperties: {\r\n addTrackingProperties: Hpm.HttpPostMessage.addTrackingProperties,\r\n getTrackingProperties: Hpm.HttpPostMessage.getTrackingProperties,\r\n },\r\n isErrorMessage: Hpm.HttpPostMessage.isErrorMessage,\r\n name: 'HostProxyDefaultNoHandlers',\r\n logMessages\r\n });\r\n hpm = new Hpm.HttpPostMessage(wpmp, {\r\n origin: 'sdk',\r\n 'sdk-type': 'js',\r\n 'sdk-version': '2.0.0'\r\n });\r\n const router = new Router.Router(wpmp);\r\n router.post('/report/events/loaded', (req, res) => {\r\n handler.handle(req);\r\n res.send(202);\r\n });\r\n router.post('/report/events/pageChanged', (req, res) => {\r\n handler.handle(req);\r\n res.send(202);\r\n });\r\n router.post('/report/events/filterAdded', (req, res) => {\r\n handler.handle(req);\r\n res.send(202);\r\n });\r\n router.post('/report/events/filterUpdated', (req, res) => {\r\n handler.handle(req);\r\n res.send(202);\r\n });\r\n router.post('/report/events/filterRemoved', (req, res) => {\r\n handler.handle(req);\r\n res.send(202);\r\n });\r\n router.post('/report/events/filtersCleared', (req, res) => {\r\n handler.handle(req);\r\n res.send(202);\r\n });\r\n router.post('/report/events/settingsUpdated', (req, res) => {\r\n handler.handle(req);\r\n res.send(202);\r\n });\r\n router.post('/report/events/dataSelected', (req, res) => {\r\n handler.handle(req);\r\n res.send(202);\r\n });\r\n \r\n handler = {\r\n test: jasmine.createSpy(\"testSpy\").and.returnValue(true),\r\n handle: jasmine.createSpy(\"handleSpy\").and.callFake(function (message: any) {\r\n message.handled = true;\r\n return message;\r\n })\r\n };\r\n \r\n spyHandler = handler;\r\n wpmp.addHandler(handler);\r\n \r\n const iframeLoadedDeferred = createDeferred();\r\n iframe.addEventListener('load', () => {\r\n iframeLoadedDeferred.resolve();\r\n });\r\n iframeLoaded = iframeLoadedDeferred.promise;\r\n });\r\n \r\n afterAll(function () { \r\n //wpmp.stop();\r\n });\r\n \r\n beforeEach(() => {\r\n // empty\r\n });\r\n \r\n afterEach(function () {\r\n spyHandler.test.calls.reset();\r\n spyHandler.handle.calls.reset();\r\n });\r\n\r\n describe('SDK-to-REPORT', function () {\r\n describe('load', function () {\r\n it('POST /report/load returns 400 if the request is invalid', function (done) {\r\n // Arrange\r\n const testData = {\r\n load: {\r\n reportId: \"fakeId\",\r\n accessToken: \"fakeToken\",\r\n options: {\r\n }\r\n }\r\n };\r\n \r\n iframeLoaded\r\n .then(() => {\r\n spyApp.validateLoad.and.returnValue(Promise.reject(null));\r\n \r\n // Act\r\n hpm.post('/report/load', testData.load)\r\n .then(() => {\r\n expect(false).toBe(true);\r\n spyApp.validateLoad.calls.reset();\r\n done();\r\n })\r\n .catch((response: Hpm.IResponse) => {\r\n // Assert\r\n expect(spyApp.validateLoad).toHaveBeenCalledWith(testData.load);\r\n expect(spyApp.load).not.toHaveBeenCalledWith(testData.load);\r\n expect(response.statusCode).toEqual(400);\r\n // Cleanup\r\n spyApp.validateLoad.calls.reset();\r\n done();\r\n });\r\n });\r\n });\r\n \r\n it('POST /report/load returns 202 if the request is valid', function (done) {\r\n // Arrange\r\n const testData = {\r\n load: {\r\n reportId: \"fakeId\",\r\n accessToken: \"fakeToken\",\r\n options: {\r\n }\r\n }\r\n };\r\n \r\n iframeLoaded\r\n .then(() => {\r\n spyApp.validateLoad.and.returnValue(Promise.resolve(null));\r\n // Act\r\n hpm.post('/report/load', testData.load)\r\n .then((response: Hpm.IResponse) => {\r\n // Assert\r\n expect(spyApp.validateLoad).toHaveBeenCalledWith(testData.load);\r\n expect(spyApp.load).toHaveBeenCalledWith(testData.load);\r\n expect(response.statusCode).toEqual(202);\r\n // Cleanup\r\n spyApp.validateLoad.calls.reset();\r\n spyApp.load.calls.reset();\r\n done();\r\n });\r\n });\r\n });\r\n \r\n it('POST /report/load causes POST /report/events/loaded', function (done) {\r\n // Arrange\r\n const testData = {\r\n load: {\r\n reportId: \"fakeId\",\r\n accessToken: \"fakeToken\",\r\n options: {\r\n pageNavigationEnabled: false\r\n }\r\n },\r\n expectedEvent: {\r\n method: 'POST',\r\n url: '/report/events/loaded',\r\n body: {\r\n initiator: 'sdk'\r\n }\r\n }\r\n };\r\n \r\n iframeLoaded\r\n .then(() => {\r\n spyApp.load.and.returnValue(Promise.resolve(testData.load));\r\n \r\n // Act\r\n hpm.post('/report/load', testData.load)\r\n .then((response: Hpm.IResponse) => {\r\n setTimeout(() => {\r\n // Assert\r\n expect(spyApp.validateLoad).toHaveBeenCalledWith(testData.load);\r\n expect(spyApp.load).toHaveBeenCalledWith(testData.load);\r\n expect(spyHandler.handle).toHaveBeenCalledWith(jasmine.objectContaining(testData.expectedEvent));\r\n // Cleanup\r\n spyApp.validateLoad.calls.reset();\r\n spyApp.load.calls.reset();\r\n done();\r\n });\r\n });\r\n });\r\n });\r\n });\r\n \r\n describe('pages', function () {\r\n \r\n it('GET /report/pages returns 200 with body as array of pages', function (done) {\r\n // Arrange\r\n const testData = {\r\n expectedPages: [\r\n {\r\n name: \"a\"\r\n },\r\n {\r\n name: \"b\"\r\n }\r\n ]\r\n };\r\n \r\n iframeLoaded\r\n .then(() => {\r\n spyApp.getPages.and.returnValue(Promise.resolve(testData.expectedPages));\r\n // Act\r\n hpm.get('/report/pages')\r\n .then((response: Hpm.IResponse) => {\r\n // Assert\r\n expect(spyApp.getPages).toHaveBeenCalled();\r\n const pages = response.body;\r\n expect(pages).toEqual(testData.expectedPages);\r\n // Cleanup\r\n spyApp.getPages.calls.reset();\r\n done();\r\n });\r\n });\r\n });\r\n \r\n it('PUT /report/pages/active returns 400 if request is invalid', function (done) {\r\n // Arrange\r\n const testData = {\r\n page: {\r\n name: \"fakeName\",\r\n displayName: \"fakeDisplayName\"\r\n }\r\n };\r\n \r\n iframeLoaded\r\n .then(() => {\r\n spyApp.validatePage.and.returnValue(Promise.reject(null));\r\n // Act\r\n hpm.put('/report/pages/active', testData.page)\r\n .catch((response: Hpm.IResponse) => {\r\n // Assert\r\n expect(spyApp.validatePage).toHaveBeenCalledWith(testData.page);\r\n expect(spyApp.setActivePage).not.toHaveBeenCalled();\r\n expect(response.statusCode).toEqual(400);\r\n // Cleanup\r\n spyApp.validatePage.calls.reset();\r\n spyApp.setActivePage.calls.reset();\r\n done();\r\n });\r\n });\r\n });\r\n \r\n it('PUT /report/pages/active returns 202 if request is valid', function (done) {\r\n // Arrange\r\n const testData = {\r\n page: {\r\n name: \"fakeName\",\r\n displayName: \"fakeDisplayName\"\r\n }\r\n };\r\n \r\n iframeLoaded\r\n .then(() => {\r\n spyApp.validatePage.and.returnValue(Promise.resolve(null));\r\n\r\n // Act\r\n hpm.put('/report/pages/active', testData.page)\r\n .then((response: Hpm.IResponse) => {\r\n // Assert\r\n expect(spyApp.validatePage).toHaveBeenCalledWith(testData.page);\r\n expect(spyApp.setActivePage).toHaveBeenCalledWith(testData.page);\r\n expect(response.statusCode).toEqual(202);\r\n // Cleanup\r\n spyApp.validatePage.calls.reset();\r\n spyApp.setActivePage.calls.reset();\r\n done();\r\n });\r\n });\r\n });\r\n \r\n it('PUT /report/pages/active causes POST /report/events/pageChanged', function (done) {\r\n // Arrange\r\n const testData = {\r\n page: {\r\n name: \"fakeName\",\r\n displayName: \"fakeDisplayName\"\r\n },\r\n expectedEvent: {\r\n method: 'POST',\r\n url: '/report/events/pageChanged',\r\n body: jasmine.objectContaining({\r\n initiator: 'sdk'\r\n })\r\n }\r\n };\r\n \r\n iframeLoaded\r\n .then(() => {\r\n spyApp.validatePage.and.returnValue(Promise.resolve(null));\r\n\r\n // Act\r\n hpm.put('/report/pages/active', testData.page)\r\n .then((response: Hpm.IResponse) => {\r\n // Assert\r\n expect(spyApp.validatePage).toHaveBeenCalledWith(testData.page);\r\n expect(spyApp.setActivePage).toHaveBeenCalledWith(testData.page);\r\n expect(response.statusCode).toEqual(202);\r\n expect(spyHandler.handle).toHaveBeenCalledWith(jasmine.objectContaining(testData.expectedEvent));\r\n // Cleanup\r\n spyApp.validateLoad.calls.reset();\r\n spyApp.setActivePage.calls.reset();\r\n done();\r\n });\r\n });\r\n });\r\n });\r\n \r\n describe('filters (report level)', function () {\r\n \r\n it('GET /report/filters returns 200 with body as array of filters', function (done) {\r\n // Arrange\r\n const testData = {\r\n filters: [\r\n {\r\n name: \"fakeFilter1\"\r\n },\r\n {\r\n name: \"fakeFilter2\"\r\n }\r\n ]\r\n };\r\n \r\n iframeLoaded\r\n .then(() => {\r\n spyApp.getFilters.and.returnValue(Promise.resolve(testData.filters));\r\n \r\n // Act\r\n hpm.get('/report/filters')\r\n .then((response: Hpm.IResponse) => {\r\n // Assert\r\n expect(spyApp.getFilters).toHaveBeenCalled();\r\n expect(response.statusCode).toEqual(200);\r\n expect(response.body).toEqual(testData.filters);\r\n // Cleanup\r\n spyApp.getFilters.calls.reset();\r\n done();\r\n });\r\n });\r\n });\r\n \r\n it('POST /report/filters returns 400 if request is invalid', function (done) {\r\n // Arrange\r\n const testData = {\r\n filter: {\r\n name: \"fakeFilter\"\r\n }\r\n };\r\n \r\n iframeLoaded\r\n .then(() => {\r\n spyApp.validateFilter.and.returnValue(Promise.reject(null));\r\n\r\n // Act\r\n hpm.post('/report/filters', testData.filter)\r\n .catch((response: Hpm.IResponse) => {\r\n // Assert\r\n expect(spyApp.validateFilter).toHaveBeenCalledWith(testData.filter);\r\n expect(spyApp.addFilter).not.toHaveBeenCalled();\r\n expect(response.statusCode).toEqual(400);\r\n // Cleanup\r\n spyApp.validateFilter.calls.reset();\r\n done();\r\n });\r\n });\r\n });\r\n \r\n it('POST /report/filters returns 202 if request is valid', function (done) {\r\n // Arrange\r\n const testData = {\r\n filter: {\r\n name: \"fakeFilter\"\r\n }\r\n };\r\n \r\n iframeLoaded\r\n .then(() => {\r\n spyApp.validateFilter.and.returnValue(Promise.resolve(null));\r\n\r\n // Act\r\n hpm.post('/report/filters', testData.filter)\r\n .then((response: Hpm.IResponse) => {\r\n // Assert\r\n expect(spyApp.validateFilter).toHaveBeenCalledWith(testData.filter);\r\n expect(spyApp.addFilter).toHaveBeenCalledWith(testData.filter);\r\n expect(response.statusCode).toEqual(202);\r\n // Cleanup\r\n spyApp.validateFilter.calls.reset();\r\n spyApp.addFilter.calls.reset();\r\n done();\r\n });\r\n });\r\n });\r\n \r\n it('POST /report/filters will cause POST /report/events/filterAdded', function (done) {\r\n // Arrange\r\n const testData = {\r\n filter: {\r\n name: \"fakeFilter\"\r\n },\r\n expectedEvent: {\r\n method: 'POST',\r\n url: '/report/events/filterAdded'\r\n }\r\n };\r\n \r\n iframeLoaded\r\n .then(() => {\r\n spyApp.validateFilter.and.returnValue(Promise.resolve(null));\r\n\r\n // Act\r\n hpm.post('/report/filters', testData.filter)\r\n .then((response: Hpm.IResponse) => {\r\n // Assert\r\n expect(spyApp.validateFilter).toHaveBeenCalledWith(testData.filter);\r\n expect(spyApp.addFilter).toHaveBeenCalledWith(testData.filter);\r\n expect(response.statusCode).toEqual(202);\r\n expect(spyHandler.handle).toHaveBeenCalledWith(jasmine.objectContaining(testData.expectedEvent));\r\n // Cleanup\r\n spyApp.validateFilter.calls.reset();\r\n spyApp.addFilter.calls.reset();\r\n done();\r\n });\r\n });\r\n });\r\n \r\n it('PUT /report/filters returns 400 if request is invalid', function (done) {\r\n // Arrange\r\n const testData = {\r\n filter: {\r\n name: \"fakeFilter\"\r\n }\r\n };\r\n \r\n iframeLoaded\r\n .then(() => {\r\n spyApp.validateFilter.and.returnValue(Promise.reject(null));\r\n\r\n // Act\r\n hpm.put('/report/filters', testData.filter)\r\n .catch((response: Hpm.IResponse) => {\r\n // Assert\r\n expect(spyApp.validateFilter).toHaveBeenCalledWith(testData.filter);\r\n expect(spyApp.updateFilter).not.toHaveBeenCalled();\r\n expect(response.statusCode).toEqual(400);\r\n // Cleanup\r\n spyApp.validateFilter.calls.reset();\r\n done();\r\n });\r\n });\r\n });\r\n \r\n it('PUT /report/filters returns 202 if request is valid', function (done) {\r\n // Arrange\r\n const testData = {\r\n filter: {\r\n name: \"fakeFilter\"\r\n }\r\n };\r\n \r\n iframeLoaded\r\n .then(() => {\r\n spyApp.validateFilter.and.returnValue(Promise.resolve(null));\r\n\r\n // Act\r\n hpm.put('/report/filters', testData.filter)\r\n .then((response: Hpm.IResponse) => {\r\n // Assert\r\n expect(spyApp.validateFilter).toHaveBeenCalledWith(testData.filter);\r\n expect(spyApp.updateFilter).toHaveBeenCalledWith(testData.filter);\r\n expect(response.statusCode).toEqual(202);\r\n // Cleanup\r\n spyApp.validateFilter.calls.reset();\r\n spyApp.updateFilter.calls.reset();\r\n done();\r\n });\r\n });\r\n });\r\n \r\n it('PUT /report/filters will cause POST /report/events/filterUpdated', function (done) {\r\n // Arrange\r\n const testData = {\r\n filter: {\r\n name: \"fakeFilter\"\r\n },\r\n expectedEvent: {\r\n method: 'POST',\r\n url: '/report/events/filterUpdated'\r\n }\r\n };\r\n \r\n iframeLoaded\r\n .then(() => {\r\n spyApp.validateFilter.and.returnValue(Promise.resolve(null));\r\n\r\n // Act\r\n hpm.put('/report/filters', testData.filter)\r\n .then((response: Hpm.IResponse) => {\r\n // Assert\r\n expect(spyApp.validateFilter).toHaveBeenCalledWith(testData.filter);\r\n expect(spyApp.updateFilter).toHaveBeenCalledWith(testData.filter);\r\n expect(response.statusCode).toEqual(202);\r\n expect(spyHandler.handle).toHaveBeenCalledWith(jasmine.objectContaining(testData.expectedEvent));\r\n // Cleanup\r\n spyApp.validateFilter.calls.reset();\r\n spyApp.updateFilter.calls.reset();\r\n done();\r\n });\r\n });\r\n });\r\n \r\n it('DELETE /report/filters returns 202 if request is valid', function (done) {\r\n // Arrange\r\n iframeLoaded\r\n .then(() => {\r\n // Act\r\n hpm.delete('/report/filters')\r\n .then((response: Hpm.IResponse) => {\r\n // Assert\r\n expect(spyApp.clearFilters).toHaveBeenCalled();\r\n expect(response.statusCode).toEqual(202);\r\n // Cleanup\r\n spyApp.clearFilters.calls.reset();\r\n done();\r\n });\r\n });\r\n });\r\n \r\n it('DELETE /report/filters causes POST /report/events/filtersCleared', function (done) {\r\n // Arrange\r\n const testData = {\r\n expectedEvent: {\r\n method: 'POST',\r\n url: '/report/events/filtersCleared'\r\n }\r\n };\r\n \r\n iframeLoaded\r\n .then(() => {\r\n \r\n // Act\r\n hpm.delete('/report/filters')\r\n .then((response: Hpm.IResponse) => {\r\n // Assert\r\n setTimeout(() => {\r\n expect(spyApp.clearFilters).toHaveBeenCalled();\r\n expect(response.statusCode).toEqual(202);\r\n expect(spyHandler.handle).toHaveBeenCalledWith(jasmine.objectContaining(testData.expectedEvent));\r\n // Cleanup\r\n spyApp.clearFilters.calls.reset();\r\n done();\r\n })\r\n });\r\n });\r\n });\r\n });\r\n \r\n describe('settings', function () {\r\n \r\n it('PATCH /report/settings returns 400 if request is invalid', function (done) {\r\n // Arrange\r\n const testData = {\r\n settings: {\r\n filterPaneEnabled: false,\r\n pageNavigationEnabled: false\r\n }\r\n };\r\n \r\n iframeLoaded\r\n .then(() => {\r\n spyApp.validateSettings.and.returnValue(Promise.reject(null));\r\n \r\n // Act\r\n hpm.patch('/report/settings', testData.settings)\r\n .catch((response: Hpm.IResponse) => {\r\n // Assert\r\n expect(spyApp.validateSettings).toHaveBeenCalledWith(testData.settings);\r\n expect(spyApp.updateSettings).not.toHaveBeenCalled();\r\n expect(response.statusCode).toEqual(400);\r\n // Cleanup\r\n spyApp.validateSettings.calls.reset();\r\n done();\r\n });\r\n });\r\n });\r\n \r\n it('PATCH /report/settings returns 202 if request is valid', function (done) {\r\n // Arrange\r\n const testData = {\r\n settings: {\r\n filterPaneEnabled: false,\r\n pageNavigationEnabled: false\r\n }\r\n };\r\n \r\n iframeLoaded\r\n .then(() => {\r\n spyApp.validateSettings.and.returnValue(Promise.resolve(null));\r\n \r\n // Act\r\n hpm.patch('/report/settings', testData.settings)\r\n .then((response: Hpm.IResponse) => {\r\n // Assert\r\n expect(spyApp.validateSettings).toHaveBeenCalledWith(testData.settings);\r\n expect(spyApp.updateSettings).toHaveBeenCalledWith(testData.settings);\r\n expect(response.statusCode).toEqual(202);\r\n // Cleanup\r\n spyApp.validateSettings.calls.reset();\r\n spyApp.updateSettings.calls.reset();\r\n done();\r\n });\r\n });\r\n });\r\n \r\n it('PATCH /report/settings causes POST /report/events/settingsUpdated', function (done) {\r\n // Arrange\r\n const testData = {\r\n settings: {\r\n filterPaneEnabled: false\r\n },\r\n expectedEvent: {\r\n method: 'POST',\r\n url: '/report/events/settingsUpdated',\r\n body: {\r\n initiator: 'sdk',\r\n settings: {\r\n filterPaneEnabled: false,\r\n pageNavigationEnabled: false\r\n }\r\n }\r\n }\r\n };\r\n \r\n iframeLoaded\r\n .then(() => {\r\n spyApp.validateSettings.and.returnValue(Promise.resolve(null));\r\n spyApp.updateSettings.and.returnValue(Promise.resolve(testData.expectedEvent.body.settings));\r\n \r\n // Act\r\n hpm.patch('/report/settings', testData.settings)\r\n .then((response: Hpm.IResponse) => {\r\n // Assert\r\n setTimeout(() => {\r\n expect(spyApp.validateSettings).toHaveBeenCalledWith(testData.settings);\r\n expect(spyApp.updateSettings).toHaveBeenCalledWith(testData.settings);\r\n expect(response.statusCode).toEqual(202);\r\n expect(spyHandler.handle).toHaveBeenCalledWith(jasmine.objectContaining(testData.expectedEvent));\r\n // Cleanup\r\n spyApp.validateSettings.calls.reset();\r\n spyApp.updateSettings.calls.reset();\r\n \r\n done();\r\n });\r\n });\r\n });\r\n });\r\n });\r\n });\r\n \r\n describe('REPORT-to-SDK', function () {\r\n describe('pages', function () {\r\n it('POST /report/events/pageChanged when user changes page', function (done) {\r\n // Arrange\r\n const testData = {\r\n event: {\r\n initiator: 'user',\r\n page: {\r\n name: \"fakePageName\"\r\n }\r\n }\r\n };\r\n const testExpectedRequest = {\r\n method: 'POST',\r\n url: '/report/events/pageChanged',\r\n body: testData.event\r\n };\r\n \r\n iframeLoaded\r\n .then(() => {\r\n \r\n // Act\r\n iframeHpm.post('/report/events/pageChanged', testData.event)\r\n .then((response: Hpm.IResponse) => {\r\n // Assert\r\n expect(response.statusCode).toBe(202);\r\n expect(spyHandler.handle).toHaveBeenCalledWith(jasmine.objectContaining(testExpectedRequest));\r\n \r\n done();\r\n });\r\n \r\n // Cleanup\r\n });\r\n });\r\n });\r\n \r\n describe('filters (report level)', function () {\r\n it('POST /report/events/filterAdded when user adds filter', function (done) {\r\n // Arrange\r\n const testData = {\r\n event: {\r\n initiator: 'user',\r\n filter: {\r\n name: \"fakeFilter\"\r\n }\r\n }\r\n };\r\n const testExpectedRequest = {\r\n method: 'POST',\r\n url: '/report/events/filterAdded',\r\n body: testData.event\r\n };\r\n \r\n iframeLoaded\r\n .then(() => {\r\n \r\n // Act\r\n iframeHpm.post('/report/events/filterAdded', testData.event)\r\n .then((response: Hpm.IResponse) => {\r\n // Assert\r\n expect(response.statusCode).toBe(202);\r\n expect(spyHandler.handle).toHaveBeenCalledWith(jasmine.objectContaining(testExpectedRequest));\r\n \r\n done();\r\n });\r\n \r\n // Cleanup\r\n });\r\n });\r\n \r\n it('POST /report/events/filterUpdated when user changes filter', function (done) {\r\n // Arrange\r\n const testData = {\r\n event: {\r\n initiator: 'user',\r\n filter: {\r\n name: \"fakeFilter\"\r\n }\r\n }\r\n };\r\n const testExpectedRequest = {\r\n method: 'POST',\r\n url: '/report/events/filterUpdated',\r\n body: testData.event\r\n };\r\n \r\n iframeLoaded\r\n .then(() => {\r\n \r\n // Act\r\n iframeHpm.post('/report/events/filterUpdated', testData.event)\r\n .then((response: Hpm.IResponse) => {\r\n // Assert\r\n expect(response.statusCode).toBe(202);\r\n expect(spyHandler.handle).toHaveBeenCalledWith(jasmine.objectContaining(testExpectedRequest));\r\n \r\n done();\r\n });\r\n \r\n // Cleanup\r\n });\r\n });\r\n \r\n it('POST /report/events/filterRemoved when user removes filter', function (done) {\r\n // Arrange\r\n const testData = {\r\n event: {\r\n initiator: 'user',\r\n filter: {\r\n name: \"fakeFilter\"\r\n }\r\n }\r\n };\r\n const testExpectedRequest = {\r\n method: 'POST',\r\n url: '/report/events/filterRemoved',\r\n body: testData.event\r\n };\r\n \r\n iframeLoaded\r\n .then(() => {\r\n \r\n // Act\r\n iframeHpm.post('/report/events/filterRemoved', testData.event)\r\n .then((response: Hpm.IResponse) => {\r\n // Assert\r\n expect(response.statusCode).toBe(202);\r\n expect(spyHandler.handle).toHaveBeenCalledWith(jasmine.objectContaining(testExpectedRequest));\r\n \r\n done();\r\n });\r\n \r\n // Cleanup\r\n });\r\n });\r\n });\r\n \r\n describe('settings', function () {\r\n it('POST /report/events/settingsUpdated when user changes settings', function (done) {\r\n // Arrange\r\n const testData = {\r\n event: {\r\n initiator: 'user',\r\n settings: {\r\n pageNavigationEnabled: true\r\n }\r\n }\r\n };\r\n const testExpectedRequest = {\r\n method: 'POST',\r\n url: '/report/events/settingsUpdated',\r\n body: testData.event\r\n };\r\n \r\n iframeLoaded\r\n .then(() => {\r\n \r\n // Act\r\n iframeHpm.post('/report/events/settingsUpdated', testData.event)\r\n .then((response: Hpm.IResponse) => {\r\n // Assert\r\n expect(response.statusCode).toBe(202);\r\n expect(spyHandler.handle).toHaveBeenCalledWith(jasmine.objectContaining(testExpectedRequest));\r\n \r\n done();\r\n });\r\n \r\n // Cleanup\r\n });\r\n });\r\n });\r\n \r\n describe('data selection', function () {\r\n it('POST /report/events/dataSelected when user selects data', function (done) {\r\n // Arrange\r\n const testData = {\r\n event: {\r\n initiator: 'user',\r\n selection: {\r\n data: true\r\n }\r\n }\r\n };\r\n const testExpectedRequest = {\r\n method: 'POST',\r\n url: '/report/events/dataSelected',\r\n body: testData.event\r\n };\r\n \r\n iframeLoaded\r\n .then(() => {\r\n \r\n // Act\r\n iframeHpm.post('/report/events/dataSelected', testData.event)\r\n .then((response: Hpm.IResponse) => {\r\n // Assert\r\n expect(response.statusCode).toBe(202);\r\n expect(spyHandler.handle).toHaveBeenCalledWith(jasmine.objectContaining(testExpectedRequest));\r\n done();\r\n });\r\n \r\n // Cleanup\r\n });\r\n });\r\n });\r\n });\r\n});\r\n\n\n\n/** WEBPACK FOOTER **\n ** ./e2e/protocol.e2e.spec.ts\n **/","(function (factory) {\r\n if (typeof module === 'object' && typeof module.exports === 'object') {\r\n var v = factory(require, exports); if (v !== undefined) module.exports = v;\r\n }\r\n else if (typeof define === 'function' && define.amd) {\r\n define([\"require\", \"exports\"], factory);\r\n }\r\n})(function (require, exports) {\r\n \"use strict\";\r\n var WindowPostMessageProxy = (function () {\r\n function WindowPostMessageProxy(contentWindow, options) {\r\n var _this = this;\r\n if (options === void 0) { options = {\r\n processTrackingProperties: {\r\n addTrackingProperties: WindowPostMessageProxy.defaultAddTrackingProperties,\r\n getTrackingProperties: WindowPostMessageProxy.defaultGetTrackingProperties\r\n },\r\n isErrorMessage: WindowPostMessageProxy.defaultIsErrorMessage,\r\n receiveWindow: window,\r\n name: WindowPostMessageProxy.createRandomString()\r\n }; }\r\n this.pendingRequestPromises = {};\r\n // save contentWindow\r\n this.contentWindow = contentWindow;\r\n // save options with defaults\r\n this.addTrackingProperties = (options.processTrackingProperties && options.processTrackingProperties.addTrackingProperties) || WindowPostMessageProxy.defaultAddTrackingProperties;\r\n this.getTrackingProperties = (options.processTrackingProperties && options.processTrackingProperties.getTrackingProperties) || WindowPostMessageProxy.defaultGetTrackingProperties;\r\n this.isErrorMessage = options.isErrorMessage || WindowPostMessageProxy.defaultIsErrorMessage;\r\n this.receiveWindow = options.receiveWindow || window;\r\n this.name = options.name || WindowPostMessageProxy.createRandomString();\r\n this.logMessages = options.logMessages || false;\r\n // Initialize\r\n this.handlers = [];\r\n this.windowMessageHandler = function (event) { return _this.onMessageReceived(event); };\r\n this.start();\r\n }\r\n // Static\r\n WindowPostMessageProxy.defaultAddTrackingProperties = function (message, trackingProperties) {\r\n message[WindowPostMessageProxy.messagePropertyName] = trackingProperties;\r\n return message;\r\n };\r\n WindowPostMessageProxy.defaultGetTrackingProperties = function (message) {\r\n return message[WindowPostMessageProxy.messagePropertyName];\r\n };\r\n WindowPostMessageProxy.defaultIsErrorMessage = function (message) {\r\n return !!message.error;\r\n };\r\n /**\r\n * Adds handler.\r\n * If the first handler whose test method returns true will handle the message and provide a response.\r\n */\r\n WindowPostMessageProxy.prototype.addHandler = function (handler) {\r\n this.handlers.push(handler);\r\n };\r\n /**\r\n * Removes handler.\r\n * The reference must match the original object that was provided when adding the handler.\r\n */\r\n WindowPostMessageProxy.prototype.removeHandler = function (handler) {\r\n var handlerIndex = this.handlers.indexOf(handler);\r\n if (handlerIndex == -1) {\r\n throw new Error(\"You attempted to remove a handler but no matching handler was found.\");\r\n }\r\n this.handlers.splice(handlerIndex, 1);\r\n };\r\n /**\r\n * Start listening to message events.\r\n */\r\n WindowPostMessageProxy.prototype.start = function () {\r\n this.receiveWindow.addEventListener('message', this.windowMessageHandler);\r\n };\r\n /**\r\n * Stops listening to message events.\r\n */\r\n WindowPostMessageProxy.prototype.stop = function () {\r\n this.receiveWindow.removeEventListener('message', this.windowMessageHandler);\r\n };\r\n /**\r\n * Post message to target window with tracking properties added and save deferred object referenced by tracking id.\r\n */\r\n WindowPostMessageProxy.prototype.postMessage = function (message) {\r\n // Add tracking properties to indicate message came from this proxy\r\n var trackingProperties = { id: WindowPostMessageProxy.createRandomString() };\r\n this.addTrackingProperties(message, trackingProperties);\r\n if (this.logMessages) {\r\n console.log(this.name + \" Posting message:\");\r\n console.log(JSON.stringify(message, null, ' '));\r\n }\r\n this.contentWindow.postMessage(message, \"*\");\r\n var deferred = WindowPostMessageProxy.createDeferred();\r\n this.pendingRequestPromises[trackingProperties.id] = deferred;\r\n return deferred.promise;\r\n };\r\n /**\r\n * Send response message to target window.\r\n * Response messages re-use tracking properties from a previous request message.\r\n */\r\n WindowPostMessageProxy.prototype.sendResponse = function (message, trackingProperties) {\r\n this.addTrackingProperties(message, trackingProperties);\r\n if (this.logMessages) {\r\n console.log(this.name + \" Sending response:\");\r\n console.log(JSON.stringify(message, null, ' '));\r\n }\r\n this.contentWindow.postMessage(message, \"*\");\r\n };\r\n /**\r\n * Message handler.\r\n */\r\n WindowPostMessageProxy.prototype.onMessageReceived = function (event) {\r\n var _this = this;\r\n if (this.logMessages) {\r\n console.log(this.name + \" Received message:\");\r\n console.log(\"type: \" + event.type);\r\n console.log(JSON.stringify(event.data, null, ' '));\r\n }\r\n var message = event.data;\r\n var trackingProperties = this.getTrackingProperties(message);\r\n // If this proxy instance could not find tracking properties then disregard message since we can't reliably respond\r\n if (!trackingProperties) {\r\n return;\r\n }\r\n var deferred = this.pendingRequestPromises[trackingProperties.id];\r\n // If message does not have a known ID, treat it as a request\r\n // Otherwise, treat message as response\r\n if (!deferred) {\r\n var handled = this.handlers.some(function (handler) {\r\n if (handler.test(message)) {\r\n Promise.resolve(handler.handle(message))\r\n .then(function (responseMessage) {\r\n _this.sendResponse(responseMessage, trackingProperties);\r\n });\r\n return true;\r\n }\r\n });\r\n /**\r\n * TODO: Consider returning an error message if nothing handled the message.\r\n * In the case of the Report receiving messages all of them should be handled,\r\n * however, in the case of the SDK receiving messages it's likely it won't register handlers\r\n * for all events. Perhaps make this an option at construction time.\r\n */\r\n if (!handled) {\r\n console.warn(\"Proxy(\" + this.name + \") did not handle message. Handlers: \" + this.handlers.length + \" Message: \" + JSON.stringify(message, null, '') + \".\");\r\n }\r\n }\r\n else {\r\n /**\r\n * If error message reject promise,\r\n * Otherwise, resolve promise\r\n */\r\n if (this.isErrorMessage(message)) {\r\n deferred.reject(message);\r\n }\r\n else {\r\n deferred.resolve(message);\r\n }\r\n // TODO: Move to .finally clause up where promise is created for better maitenance like original proxy code.\r\n delete this.pendingRequestPromises[trackingProperties.id];\r\n }\r\n };\r\n /**\r\n * Utility to create a deferred object.\r\n */\r\n // TODO: Look to use RSVP library instead of doing this manually.\r\n // From what I searched RSVP would work better because it has .finally and .deferred; however, it doesn't have Typings information. \r\n WindowPostMessageProxy.createDeferred = function () {\r\n var deferred = {\r\n resolve: null,\r\n reject: null,\r\n promise: null\r\n };\r\n var promise = new Promise(function (resolve, reject) {\r\n deferred.resolve = resolve;\r\n deferred.reject = reject;\r\n });\r\n deferred.promise = promise;\r\n return deferred;\r\n };\r\n /**\r\n * Utility to generate random sequence of characters used as tracking id for promises.\r\n */\r\n WindowPostMessageProxy.createRandomString = function () {\r\n return (Math.random() + 1).toString(36).substring(7);\r\n };\r\n WindowPostMessageProxy.messagePropertyName = \"windowPostMessageProxy\";\r\n return WindowPostMessageProxy;\r\n }());\r\n exports.WindowPostMessageProxy = WindowPostMessageProxy;\r\n});\r\n//# sourceMappingURL=windowPostMessageProxy.js.map\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/window-post-message-proxy/dist/windowPostMessageProxy.js\n ** module id = 1\n ** module chunks = 0\n **/","var map = {\n\t\"./windowPostMessageProxy\": 1,\n\t\"./windowPostMessageProxy.js\": 1\n};\nfunction webpackContext(req) {\n\treturn __webpack_require__(webpackContextResolve(req));\n};\nfunction webpackContextResolve(req) {\n\treturn map[req] || (function() { throw new Error(\"Cannot find module '\" + req + \"'.\") }());\n};\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 2;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/window-post-message-proxy/dist ^\\.\\/.*$\n ** module id = 2\n ** module chunks = 0\n **/","(function (factory) {\r\n if (typeof module === 'object' && typeof module.exports === 'object') {\r\n var v = factory(require, exports); if (v !== undefined) module.exports = v;\r\n }\r\n else if (typeof define === 'function' && define.amd) {\r\n define([\"require\", \"exports\"], factory);\r\n }\r\n})(function (require, exports) {\r\n \"use strict\";\r\n var HttpPostMessage = (function () {\r\n function HttpPostMessage(windowPostMessageProxy, defaultHeaders) {\r\n if (defaultHeaders === void 0) { defaultHeaders = {}; }\r\n this.defaultHeaders = defaultHeaders;\r\n this.windowPostMessageProxy = windowPostMessageProxy;\r\n }\r\n // TODO: I the responsibility of knowing how to configure windowPostMessageProxy should\r\n // live in this class, but then we have to have hard dependency for things like ITrackingProperties\r\n HttpPostMessage.addTrackingProperties = function (message, trackingProperties) {\r\n message.headers = message.headers || {};\r\n message.headers.id = trackingProperties.id;\r\n return message;\r\n };\r\n HttpPostMessage.getTrackingProperties = function (message) {\r\n return {\r\n id: message.headers.id\r\n };\r\n };\r\n HttpPostMessage.isErrorMessage = function (message) {\r\n return !(200 <= message.statusCode && message.statusCode < 300);\r\n };\r\n HttpPostMessage.prototype.get = function (url, headers) {\r\n if (headers === void 0) { headers = {}; }\r\n return this.send({\r\n method: \"GET\",\r\n url: url,\r\n headers: headers\r\n });\r\n };\r\n HttpPostMessage.prototype.post = function (url, body, headers) {\r\n if (headers === void 0) { headers = {}; }\r\n return this.send({\r\n method: \"POST\",\r\n url: url,\r\n headers: headers,\r\n body: body\r\n });\r\n };\r\n HttpPostMessage.prototype.put = function (url, body, headers) {\r\n if (headers === void 0) { headers = {}; }\r\n return this.send({\r\n method: \"PUT\",\r\n url: url,\r\n headers: headers,\r\n body: body\r\n });\r\n };\r\n HttpPostMessage.prototype.patch = function (url, body, headers) {\r\n if (headers === void 0) { headers = {}; }\r\n return this.send({\r\n method: \"PATCH\",\r\n url: url,\r\n headers: headers,\r\n body: body\r\n });\r\n };\r\n HttpPostMessage.prototype.delete = function (url, headers) {\r\n if (headers === void 0) { headers = {}; }\r\n return this.send({\r\n method: \"DELETE\",\r\n url: url,\r\n headers: headers\r\n });\r\n };\r\n HttpPostMessage.prototype.send = function (request) {\r\n this.assign(request.headers, this.defaultHeaders);\r\n return this.windowPostMessageProxy.postMessage(request);\r\n };\r\n /**\r\n * Object.assign() polyfill\r\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\r\n */\r\n HttpPostMessage.prototype.assign = function (target) {\r\n var sources = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n sources[_i - 1] = arguments[_i];\r\n }\r\n if (target === undefined || target === null) {\r\n throw new TypeError('Cannot convert undefined or null to object');\r\n }\r\n var output = Object(target);\r\n sources.forEach(function (source) {\r\n if (source !== undefined && source !== null) {\r\n for (var nextKey in source) {\r\n if (Object.prototype.hasOwnProperty.call(source, nextKey)) {\r\n output[nextKey] = source[nextKey];\r\n }\r\n }\r\n }\r\n });\r\n return output;\r\n };\r\n return HttpPostMessage;\r\n }());\r\n exports.HttpPostMessage = HttpPostMessage;\r\n});\r\n//# sourceMappingURL=httpPostMessage.js.map\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/http-post-message/dist/httpPostMessage.js\n ** module id = 5\n ** module chunks = 0\n **/","var map = {\n\t\"./httpPostMessage\": 5,\n\t\"./httpPostMessage.js\": 5\n};\nfunction webpackContext(req) {\n\treturn __webpack_require__(webpackContextResolve(req));\n};\nfunction webpackContextResolve(req) {\n\treturn map[req] || (function() { throw new Error(\"Cannot find module '\" + req + \"'.\") }());\n};\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 6;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/http-post-message/dist ^\\.\\/.*$\n ** module id = 6\n ** module chunks = 0\n **/","(function (factory) {\r\n if (typeof module === 'object' && typeof module.exports === 'object') {\r\n var v = factory(require, exports); if (v !== undefined) module.exports = v;\r\n }\r\n else if (typeof define === 'function' && define.amd) {\r\n define([\"require\", \"exports\"], factory);\r\n }\r\n})(function (require, exports) {\r\n \"use strict\";\r\n var Router = (function () {\r\n function Router(handlers) {\r\n this.handlers = handlers;\r\n }\r\n Router.prototype.get = function (url, handler) {\r\n this.registerHandler(\"GET\", url, handler);\r\n return this;\r\n };\r\n Router.prototype.patch = function (url, handler) {\r\n this.registerHandler(\"PATCH\", url, handler);\r\n return this;\r\n };\r\n Router.prototype.post = function (url, handler) {\r\n this.registerHandler(\"POST\", url, handler);\r\n return this;\r\n };\r\n Router.prototype.put = function (url, handler) {\r\n this.registerHandler(\"PUT\", url, handler);\r\n return this;\r\n };\r\n Router.prototype.delete = function (url, handler) {\r\n this.registerHandler(\"DELETE\", url, handler);\r\n return this;\r\n };\r\n Router.prototype.registerHandler = function (method, url, handler) {\r\n var internalHandler = {\r\n test: function (request) {\r\n return (request.method === method\r\n && request.url === url);\r\n },\r\n handle: function (request) {\r\n var response = new Response();\r\n return Promise.resolve(handler(request, response))\r\n .then(function (x) { return response; });\r\n }\r\n };\r\n this.handlers.addHandler(internalHandler);\r\n };\r\n return Router;\r\n }());\r\n exports.Router = Router;\r\n var Response = (function () {\r\n function Response() {\r\n this.statusCode = 200;\r\n this.headers = {};\r\n this.body = null;\r\n }\r\n Response.prototype.send = function (statusCode, body) {\r\n this.statusCode = statusCode;\r\n this.body = body;\r\n };\r\n return Response;\r\n }());\r\n exports.Response = Response;\r\n});\r\n//# sourceMappingURL=router.js.map\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/powerbi-router/dist/router.js\n ** module id = 9\n ** module chunks = 0\n **/","var map = {\n\t\"./router\": 9,\n\t\"./router.js\": 9\n};\nfunction webpackContext(req) {\n\treturn __webpack_require__(webpackContextResolve(req));\n};\nfunction webpackContextResolve(req) {\n\treturn map[req] || (function() { throw new Error(\"Cannot find module '\" + req + \"'.\") }());\n};\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 10;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/powerbi-router/dist ^\\.\\/.*$\n ** module id = 10\n ** module chunks = 0\n **/","import * as Wpmp from 'window-post-message-proxy';\r\nimport * as Hpm from 'http-post-message';\r\nimport * as Router from 'powerbi-router';\r\nimport { mockAppSpyObj, mockApp } from './mockApp';\r\n\r\nexport const spyApp = mockAppSpyObj;\r\n\r\nexport function setup(iframeContentWindow: Window, parentWindow: Window, logMessages: boolean): Hpm.HttpPostMessage {\r\n const parent = parentWindow || iframeContentWindow.parent;\r\n const wpmp = new Wpmp.WindowPostMessageProxy(parentWindow, {\r\n processTrackingProperties: {\r\n addTrackingProperties: Hpm.HttpPostMessage.addTrackingProperties,\r\n getTrackingProperties: Hpm.HttpPostMessage.getTrackingProperties,\r\n },\r\n isErrorMessage: Hpm.HttpPostMessage.isErrorMessage,\r\n receiveWindow: iframeContentWindow,\r\n name: 'MockAppWindowPostMessageProxy',\r\n logMessages: false\r\n });\r\n const hpm = new Hpm.HttpPostMessage(wpmp, {\r\n origin: 'powerbi'\r\n });\r\n const router = new Router.Router(wpmp);\r\n const app = mockApp;\r\n \r\n /**\r\n * Phase 1\r\n */\r\n router.post('/report/load', (req, res) => {\r\n const loadConfig = req.body;\r\n return app.validateLoad(loadConfig)\r\n .then(() => {\r\n app.load(loadConfig)\r\n .then(() => {\r\n const initiator = \"sdk\";\r\n hpm.post('/report/events/loaded', {\r\n initiator\r\n });\r\n }, error => {\r\n hpm.post('/report/events/error', error);\r\n });\r\n \r\n res.send(202);\r\n }, error => {\r\n res.send(400, error);\r\n });\r\n });\r\n \r\n router.get('/report/pages', (req, res) => {\r\n return app.getPages()\r\n .then(pages => {\r\n res.send(200, pages);\r\n });\r\n });\r\n \r\n router.put('/report/pages/active', (req, res) => {\r\n const page = req.body;\r\n return app.validatePage(page)\r\n .then(() => {\r\n app.setActivePage(page)\r\n .then(page => {\r\n const initiator = \"sdk\";\r\n hpm.post('/report/events/pageChanged', {\r\n initiator,\r\n page\r\n });\r\n }, error => {\r\n hpm.post('/report/events/error', error);\r\n });\r\n \r\n res.send(202);\r\n }, error => {\r\n res.send(400, error);\r\n });\r\n });\r\n \r\n /**\r\n * Phase 2\r\n */\r\n router.get('/report/filters', (req, res) => {\r\n return app.getFilters()\r\n .then(filters => {\r\n res.send(200, filters);\r\n });\r\n });\r\n \r\n router.post('/report/filters', (req, res) => {\r\n const filter = req.body;\r\n return app.validateFilter(filter)\r\n .then(() => {\r\n app.addFilter(filter)\r\n .then(filter => {\r\n const initiator = \"sdk\";\r\n hpm.post('/report/events/filterAdded', {\r\n initiator,\r\n filter\r\n });\r\n }, error => {\r\n hpm.post('/report/events/error', error);\r\n });\r\n \r\n res.send(202);\r\n }, error => {\r\n res.send(400, error);\r\n });\r\n });\r\n \r\n router.put('/report/filters', (req, res) => {\r\n const filter = req.body;\r\n return app.validateFilter(filter)\r\n .then(() => {\r\n app.updateFilter(filter)\r\n .then(filter => {\r\n const initiator = \"sdk\";\r\n hpm.post('/report/events/filterUpdated', {\r\n initiator,\r\n filter\r\n });\r\n }, error => {\r\n hpm.post('/report/events/error', error);\r\n });\r\n \r\n res.send(202);\r\n }, error => {\r\n res.send(400, error);\r\n });\r\n });\r\n \r\n router.delete('/report/filters', (req, res) => {\r\n app.clearFilters()\r\n .then(filter => {\r\n const initiator = \"sdk\";\r\n hpm.post('/report/events/filtersCleared', {\r\n initiator,\r\n filter\r\n });\r\n }, error => {\r\n hpm.post('/report/events/error', error);\r\n });\r\n res.send(202);\r\n })\r\n \r\n /**\r\n * Phase 3\r\n */\r\n /**\r\n * TODO: Investigate the api for getting setting filters at targets.\r\n * Currently we are transforming the target into url parameters and then back out of url parameters\r\n * although this is more correct for use of HTTP, it might be easier to just keep it as an object in the body.\r\n */\r\n router.get('/report/pages/:pageName/filters', (req, res) => {\r\n const pageName = req.params.pageName;\r\n const target = {\r\n type: \"page\",\r\n name: pageName\r\n };\r\n \r\n return app.getFilters(target)\r\n .then(filters => {\r\n res.send(200, filters);\r\n });\r\n });\r\n \r\n router.post('/report/pages/:pageName/filters', (req, res) => {\r\n const filter = req.body;\r\n const pageName = req.params.pageName;\r\n const target = {\r\n type: \"page\",\r\n name: pageName\r\n };\r\n \r\n return app.validateFilter(filter)\r\n .then(() => {\r\n app.addFilter(filter, target)\r\n .then(filter => {\r\n const initiator = \"sdk\";\r\n hpm.post(`/report/pages/${pageName}/events/filterAdded`, {\r\n initiator,\r\n filter\r\n });\r\n }, error => {\r\n hpm.post('/report/events/error', error);\r\n });\r\n \r\n res.send(202);\r\n }, errors => {\r\n res.send(400, errors);\r\n });\r\n });\r\n \r\n router.put('/report/pages/:pageName/filters', (req, res) => {\r\n const filter = req.body;\r\n const pageName = req.params.pageName;\r\n const target = {\r\n type: \"page\",\r\n name: pageName\r\n };\r\n \r\n return app.validateFilter(filter)\r\n .then(() => {\r\n app.updateFilter(filter, target)\r\n .then(filter => {\r\n const initiator = \"sdk\";\r\n hpm.post(`/report/pages/${pageName}/events/filterUpdated`, {\r\n initiator,\r\n filter\r\n });\r\n }, error => {\r\n hpm.post('/report/events/error', error);\r\n });\r\n \r\n res.send(202);\r\n }, errors => {\r\n res.send(400, errors);\r\n });\r\n });\r\n \r\n router.put('/report/filters', (req, res) => {\r\n const filter = req.body;\r\n \r\n return app.validateFilter(filter)\r\n .then(() => {\r\n app.updateFilter(filter)\r\n .then(filter => {\r\n const initiator = \"sdk\";\r\n hpm.post(`/report/events/filterUpdated`, {\r\n initiator,\r\n filter\r\n });\r\n }, error => {\r\n hpm.post('/report/events/error', error);\r\n });\r\n \r\n res.send(202);\r\n }, errors => {\r\n res.send(400, errors);\r\n });\r\n });\r\n \r\n router.patch('/report/settings', (req, res) => {\r\n const settings = req.body;\r\n \r\n return app.validateSettings(settings)\r\n .then(() => {\r\n app.updateSettings(settings)\r\n .then(updatedSettings => {\r\n const initiator = \"sdk\";\r\n hpm.post(`/report/events/settingsUpdated`, {\r\n initiator,\r\n settings: updatedSettings\r\n });\r\n }, error => {\r\n hpm.post('/report/events/error', error);\r\n });\r\n \r\n res.send(202);\r\n }, errors => {\r\n res.send(400, errors);\r\n });\r\n })\r\n \r\n /**\r\n * Phase 4\r\n */\r\n // No work for router\r\n \r\n /**\r\n * Phase 5\r\n */\r\n router.get('/report/data', (req, res) => {\r\n const target = {\r\n type: 'visual',\r\n visual: \"xyz?\"\r\n };\r\n \r\n return app.exportData(target)\r\n .then(data => {\r\n res.send(200, data);\r\n });\r\n });\r\n \r\n return hpm;\r\n}\n\n\n/** WEBPACK FOOTER **\n ** ./e2e/utility/mockReportEmbed.ts\n **/","/**\r\n * These are the methods that should be implemented and exposed in the PowerBI angular application which can be invoked from the ReportEmbed iframe.\r\n */\r\n\r\nexport interface ILoad {\r\n reportId: string;\r\n accessToken: string;\r\n options: IOptions;\r\n}\r\n\r\nexport interface IOptions {\r\n filterPaneEnabled: boolean;\r\n pageNavigationEnabled: boolean;\r\n}\r\n\r\nexport interface IPage {\r\n name: string;\r\n displayName: string;\r\n}\r\n\r\nexport interface ITarget {\r\n // TODO?\r\n}\r\n\r\n// TODO: Replace with actual filters from 'powerbi-filters' package\r\nexport interface IFilter {\r\n // TODO?\r\n}\r\n\r\nexport interface IValidationResponse {\r\n errors: any[];\r\n}\r\n\r\nexport interface IApp {\r\n // Load\r\n load(config: ILoad): Promise;\r\n validateLoad(config: ILoad): Promise;\r\n // Settings\r\n updateSettings(settings: IOptions): Promise;\r\n validateSettings(settigns: IOptions): Promise;\r\n \r\n // Pages\r\n getPages(): Promise;\r\n setActivePage(page: IPage): Promise;\r\n togglePageNavigation(): Promise;\r\n validatePage(page: IPage): Promise;\r\n // Filters\r\n validateFilter(filter: IFilter): Promise;\r\n validateTarget(target: ITarget): Promise;\r\n getFilters(target?: ITarget): Promise;\r\n addFilter(filter: IFilter, target?: ITarget): Promise;\r\n updateFilter(filter: IFilter, target?: ITarget): Promise;\r\n removeFilter(filter: IFilter, target?: ITarget): Promise;\r\n clearFilters(target?: ITarget): Promise;\r\n toggleFilterPane(): Promise;\r\n // Other\r\n exportData(target: ITarget): Promise;\r\n}\r\n\r\nexport const mockAppSpyObj = {\r\n // Load\r\n load: jasmine.createSpy(\"load\").and.returnValue(Promise.resolve(null)),\r\n validateLoad: jasmine.createSpy(\"validateLoad\").and.returnValue(Promise.resolve(null)),\r\n // Settings\r\n updateSettings: jasmine.createSpy(\"updateSettings\").and.returnValue(Promise.resolve(null)),\r\n validateSettings: jasmine.createSpy(\"validateSettings\").and.returnValue(Promise.resolve(null)),\r\n // Pages\r\n getPages: jasmine.createSpy(\"getPages\").and.returnValue(Promise.resolve(null)),\r\n setActivePage: jasmine.createSpy(\"setActivePage\").and.returnValue(Promise.resolve(null)),\r\n togglePageNavigation: jasmine.createSpy(\"togglePageNavigation\").and.returnValue(Promise.resolve(null)),\r\n validatePage: jasmine.createSpy(\"validatePage\").and.returnValue(Promise.resolve(null)),\r\n // Filters\r\n validateFilter: jasmine.createSpy(\"validateFilter\").and.returnValue(Promise.resolve(null)),\r\n validateTarget: jasmine.createSpy(\"validateTarget\").and.returnValue(Promise.resolve(null)),\r\n getFilters: jasmine.createSpy(\"getFilters\").and.returnValue(Promise.resolve(null)),\r\n addFilter: jasmine.createSpy(\"addFilter\").and.returnValue(Promise.resolve(null)),\r\n updateFilter: jasmine.createSpy(\"updateFilter\").and.returnValue(Promise.resolve(null)),\r\n removeFilter: jasmine.createSpy(\"removeFilter\").and.returnValue(Promise.resolve(null)),\r\n clearFilters: jasmine.createSpy(\"clearFilters\").and.returnValue(Promise.resolve(null)),\r\n toggleFilterPane: jasmine.createSpy(\"toggleFilterPane\").and.returnValue(Promise.resolve(null)),\r\n // Other\r\n exportData: jasmine.createSpy(\"exportData\").and.returnValue(Promise.resolve(null))\r\n};\r\n\r\nexport const mockApp: IApp = mockAppSpyObj;\r\n\n\n\n/** WEBPACK FOOTER **\n ** ./e2e/utility/mockApp.ts\n **/"],"sourceRoot":""} \ No newline at end of file