spyne 0.19.0 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/.eslintrc.js +4 -3
  2. package/.travis.yml +24 -11
  3. package/karma.conf.js +76 -86
  4. package/lib/spyne.esm.js +15 -0
  5. package/lib/spyne.esm.js.map +1 -0
  6. package/lib/spyne.umd.js +9565 -0
  7. package/package.json +46 -26
  8. package/rollup.config.js +26 -0
  9. package/src/spyne/channels/channel-fetch-class.js +39 -43
  10. package/src/spyne/channels/channel-payload-class.js +61 -74
  11. package/src/spyne/channels/channel-proxy.js +25 -26
  12. package/src/spyne/channels/channel.js +141 -149
  13. package/src/spyne/channels/channels-config.js +46 -47
  14. package/src/spyne/channels/channels-map.js +61 -65
  15. package/src/spyne/channels/spyne-channel-lifecycle.js +12 -12
  16. package/src/spyne/channels/spyne-channel-route.js +241 -250
  17. package/src/spyne/channels/spyne-channel-ui.js +213 -75
  18. package/src/spyne/channels/spyne-channel-window.js +157 -157
  19. package/src/spyne/spyne-app.js +32 -19
  20. package/src/spyne/spyne-plugins.js +55 -70
  21. package/src/spyne/spyne.js +23 -23
  22. package/src/spyne/utils/channel-config-validator.js +10 -10
  23. package/src/spyne/utils/channel-fetch-util.js +72 -55
  24. package/src/spyne/utils/channel-payload-filter.js +89 -100
  25. package/src/spyne/utils/deep-merge.js +31 -29
  26. package/src/spyne/utils/frp-tools.js +108 -92
  27. package/src/spyne/utils/gc.js +6 -6
  28. package/src/spyne/utils/mixins/base-core-mixins.js +17 -15
  29. package/src/spyne/utils/mixins/base-streams-mixins.js +9 -9
  30. package/src/spyne/utils/route-channel-updater.js +23 -29
  31. package/src/spyne/utils/safe-clone.js +40 -58
  32. package/src/spyne/utils/sanitize-html.js +35 -0
  33. package/src/spyne/utils/security-policy.js +11 -0
  34. package/src/spyne/utils/spyne-app-properties.js +110 -114
  35. package/src/spyne/utils/spyne-logger.js +4 -11
  36. package/src/spyne/utils/spyne-plugins-methods.js +38 -63
  37. package/src/spyne/utils/spyne-trait.js +33 -33
  38. package/src/spyne/utils/spyne-utils-channel-route-url.js +229 -153
  39. package/src/spyne/utils/spyne-utils-channel-route.js +128 -138
  40. package/src/spyne/utils/spyne-utils-channel-window.js +39 -39
  41. package/src/spyne/utils/viewstream-animations.js +12 -12
  42. package/src/spyne/utils/viewstream-observables.js +45 -45
  43. package/src/spyne/views/dom-element-template.js +111 -114
  44. package/src/spyne/views/dom-element.js +82 -84
  45. package/src/spyne/views/view-stream-broadcaster.js +66 -62
  46. package/src/spyne/views/view-stream-element.js +105 -106
  47. package/src/spyne/views/view-stream-payload.js +25 -27
  48. package/src/spyne/views/view-stream-selector.js +157 -163
  49. package/src/spyne/views/view-stream.js +416 -640
  50. package/src/tests/channels/channel-dom.test.js +15 -15
  51. package/src/tests/channels/channel-fetch.test.js +51 -62
  52. package/src/tests/channels/channel-payload-class.test.js +50 -63
  53. package/src/tests/channels/channel-payload-filter.test.js +133 -193
  54. package/src/tests/channels/channel-route.test.js +102 -112
  55. package/src/tests/channels/channel-stream-item.test.js +19 -19
  56. package/src/tests/channels/channel-ui.test.js +15 -27
  57. package/src/tests/channels/channel-util-dom.test.js +31 -31
  58. package/src/tests/channels/channel.test.js +20 -25
  59. package/src/tests/channels/route-utils.test.js +61 -66
  60. package/src/tests/channels/url-utils.test.js +151 -151
  61. package/src/tests/channels/view-stream-broadcaster.test.js +7 -7
  62. package/src/tests/import.test.js +5 -5
  63. package/src/tests/index.js +6 -7
  64. package/src/tests/index.test.js +6 -8
  65. package/src/tests/mocks/channel-payload-data.js +218 -220
  66. package/src/tests/mocks/enhancer.test.js +5 -5
  67. package/src/tests/mocks/payload-ui.js +87 -90
  68. package/src/tests/mocks/routes-data.js +264 -266
  69. package/src/tests/mocks/spyne-docs.mocks.js +3 -3
  70. package/src/tests/mocks/template-renderer.mocks.js +47 -47
  71. package/src/tests/mocks/utils-data.js +78 -79
  72. package/src/tests/mocks/viewstream-internal-payload.mocks.js +50 -50
  73. package/src/tests/mocks/window-events-arr.js +1 -1
  74. package/src/tests/package-json.spec.test.js +9 -0
  75. package/src/tests/spyne-app.test.js +15 -18
  76. package/src/tests/spyne-plugin.test.js +16 -20
  77. package/src/tests/utils/channel-action-filter.test.js +84 -86
  78. package/src/tests/utils/channel-data-packet-generator.unused.js +62 -86
  79. package/src/tests/utils/channel-fetch-util.test.js +64 -66
  80. package/src/tests/utils/frp-tools.test.js +19 -19
  81. package/src/tests/utils/plugins-methods.test.js +31 -55
  82. package/src/tests/utils/security.test.js +10 -0
  83. package/src/tests/utils/spyne-app-properties.test.js +4 -8
  84. package/src/tests/views/dom-el-selectors.test.js +112 -119
  85. package/src/tests/views/dom-el-template-proxy.test.js +7 -0
  86. package/src/tests/views/dom-el-template.test.js +186 -156
  87. package/src/tests/views/dom-el.test.js +58 -56
  88. package/src/tests/views/view-stream-enhancer-loader.test.js +2 -2
  89. package/src/tests/views/view-stream-enhancer.test.js +11 -11
  90. package/src/tests/views/view-stream.test.js +22 -33
  91. package/webpack.config.js +76 -67
  92. package/docs/-_%20Solves%20equations%20of%20the%20form%20a%20_%20x%20=%20b.html +0 -487
  93. package/docs/DomItem.html +0 -298
  94. package/docs/DomItem_DomItem.html +0 -314
  95. package/docs/ViewStream.html +0 -2249
  96. package/docs/ViewStream_ViewStream.html +0 -503
  97. package/docs/custom/css/jsdoc-viewstream.css +0 -377
  98. package/docs/custom/layout.tmpl +0 -47
  99. package/docs/dom-item.js.html +0 -213
  100. package/docs/fonts/OpenSans-Bold-webfont.eot +0 -0
  101. package/docs/fonts/OpenSans-Bold-webfont.svg +0 -1830
  102. package/docs/fonts/OpenSans-Bold-webfont.woff +0 -0
  103. package/docs/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
  104. package/docs/fonts/OpenSans-BoldItalic-webfont.svg +0 -1830
  105. package/docs/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
  106. package/docs/fonts/OpenSans-Italic-webfont.eot +0 -0
  107. package/docs/fonts/OpenSans-Italic-webfont.svg +0 -1830
  108. package/docs/fonts/OpenSans-Italic-webfont.woff +0 -0
  109. package/docs/fonts/OpenSans-Light-webfont.eot +0 -0
  110. package/docs/fonts/OpenSans-Light-webfont.svg +0 -1831
  111. package/docs/fonts/OpenSans-Light-webfont.woff +0 -0
  112. package/docs/fonts/OpenSans-LightItalic-webfont.eot +0 -0
  113. package/docs/fonts/OpenSans-LightItalic-webfont.svg +0 -1835
  114. package/docs/fonts/OpenSans-LightItalic-webfont.woff +0 -0
  115. package/docs/fonts/OpenSans-Regular-webfont.eot +0 -0
  116. package/docs/fonts/OpenSans-Regular-webfont.svg +0 -1831
  117. package/docs/fonts/OpenSans-Regular-webfont.woff +0 -0
  118. package/docs/global.html +0 -548
  119. package/docs/index-custom.html +0 -79
  120. package/docs/index.html +0 -82
  121. package/docs/jsdoc.config.json +0 -22
  122. package/docs/scripts/linenumber.js +0 -25
  123. package/docs/scripts/prettify/Apache-License-2.0.txt +0 -202
  124. package/docs/scripts/prettify/lang-css.js +0 -2
  125. package/docs/scripts/prettify/prettify.js +0 -28
  126. package/docs/styles/jsdoc-default.css +0 -358
  127. package/docs/styles/prettify-jsdoc.css +0 -111
  128. package/docs/styles/prettify-tomorrow.css +0 -132
  129. package/docs/view-stream.js.html +0 -767
@@ -1,126 +1,108 @@
1
- const {expect, assert} = require('chai');
2
- import {ChannelPayloadToTestFilters} from '../mocks/channel-payload-data';
3
- import {ChannelPayloadFilter} from '../../spyne/utils/channel-payload-filter';
4
- import {ChannelPayload} from '../../spyne/channels/channel-payload-class';
5
- import {SpyneApp} from '../../spyne/spyne';
1
+ import { ChannelPayloadToTestFilters } from '../mocks/channel-payload-data'
2
+ import { ChannelPayloadFilter } from '../../spyne/utils/channel-payload-filter'
3
+ import { ChannelPayload } from '../../spyne/channels/channel-payload-class'
4
+ import { SpyneApp } from '../../spyne/spyne'
5
+ const { expect, assert } = require('chai')
6
6
 
7
- const R = require('ramda');
7
+ const R = require('ramda')
8
8
  describe('should test channel payload filters parameter configuration', () => {
9
-
10
9
  beforeEach(function() {
11
10
  // runs once before the first test in this block
12
11
  window.Spyne = {
13
- 'config' : {
14
- 'debug' : false
12
+ config : {
13
+ debug : false
15
14
  }
16
15
  }
16
+ })
17
17
 
18
- });
19
-
20
- const testModeBool = true;
21
-
18
+ const testModeBool = true
22
19
 
23
20
  it('should throw an error if cp filter is empty', () => {
24
- const cpFilter = new ChannelPayloadFilter(undefined, undefined, undefined, true);
25
- const {filtersAreEmpty} = cpFilter;
26
- expect(filtersAreEmpty).to.be.true;
27
- });
21
+ const cpFilter = new ChannelPayloadFilter(undefined, undefined, undefined, true)
22
+ const { filtersAreEmpty } = cpFilter
23
+ expect(filtersAreEmpty).to.be.true
24
+ })
28
25
 
29
26
  it('should filter selector string only', () => {
30
- const cpFilter = new ChannelPayloadFilter('.my-selector');
31
- expect(cpFilter).to.be.a('function');
32
- });
27
+ const cpFilter = new ChannelPayloadFilter('.my-selector')
28
+ expect(cpFilter).to.be.a('function')
29
+ })
33
30
 
34
31
  it('should filter selector string only but with testMode param', () => {
35
- const mySelector = '.my-selector';
36
- const cpFilter = new ChannelPayloadFilter(mySelector, {}, false, testModeBool);
37
- const {testMode, selector} = cpFilter;
32
+ const mySelector = '.my-selector'
33
+ const cpFilter = new ChannelPayloadFilter(mySelector, {}, false, testModeBool)
34
+ const { testMode, selector } = cpFilter
38
35
  const correctVals = {
39
36
  selector: mySelector,
40
37
  testMode: testModeBool
41
38
  }
42
- expect({testMode, selector}).to.deep.equal(correctVals);
43
-
44
- });
39
+ expect({ testMode, selector }).to.deep.equal(correctVals)
40
+ })
45
41
 
46
42
  it('should filter selector string and testMode param in filters', () => {
47
- const mySelector = '.my-selector';
48
- const cpFilter = new ChannelPayloadFilter({selector:mySelector, testMode:testModeBool});
49
- const {testMode, selector} = cpFilter;
43
+ const mySelector = '.my-selector'
44
+ const cpFilter = new ChannelPayloadFilter({ selector:mySelector, testMode:testModeBool })
45
+ const { testMode, selector } = cpFilter
50
46
  const correctVals = {
51
47
  selector: mySelector,
52
48
  testMode: testModeBool
53
49
  }
54
- expect({testMode, selector}).to.deep.equal(correctVals);
55
- });
50
+ expect({ testMode, selector }).to.deep.equal(correctVals)
51
+ })
56
52
 
57
53
  it('should add debugLabel as prop in filters', () => {
58
- const mySelector = '.my-selector';
59
- const cpFilter = new ChannelPayloadFilter({debugLabel: 'myTest', testMode:testModeBool});
60
- const {debugLabel} = cpFilter;
61
- expect(debugLabel).to.equal('myTest');
62
- });
54
+ const mySelector = '.my-selector'
55
+ const cpFilter = new ChannelPayloadFilter({ debugLabel: 'myTest', testMode:testModeBool })
56
+ const { debugLabel } = cpFilter
57
+ expect(debugLabel).to.equal('myTest')
58
+ })
63
59
 
64
60
  it('should filter selector array only', () => {
65
- const mySelector = ['.my-selector', '#my-button', '#my-el.tester > li'];
66
- const cpFilter = new ChannelPayloadFilter(mySelector, {}, 'myTest', testModeBool);
67
- const {testMode, selector} = cpFilter;
61
+ const mySelector = ['.my-selector', '#my-button', '#my-el.tester > li']
62
+ const cpFilter = new ChannelPayloadFilter(mySelector, {}, 'myTest', testModeBool)
63
+ const { testMode, selector } = cpFilter
68
64
  const correctVals = {
69
65
  selector: mySelector,
70
66
  testMode: testModeBool
71
67
  }
72
- expect({testMode, selector}).to.deep.equal(correctVals);
73
-
74
- });
75
-
68
+ expect({ testMode, selector }).to.deep.equal(correctVals)
69
+ })
76
70
 
77
71
  it('should filter selector array only as prop in filters', () => {
78
- const mySelector = ['.my-selector', '#my-button', '#my-el.tester > li'];
79
- const cpFilter = new ChannelPayloadFilter({selector:mySelector, debugLabel:'myTest', testMode: testModeBool }, 'notCorrect', false, false);
80
- const {selector} = cpFilter;
81
- expect(selector).to.equal(mySelector);
82
-
83
- });
84
-
72
+ const mySelector = ['.my-selector', '#my-button', '#my-el.tester > li']
73
+ const cpFilter = new ChannelPayloadFilter({ selector:mySelector, debugLabel:'myTest', testMode: testModeBool }, 'notCorrect', false, false)
74
+ const { selector } = cpFilter
75
+ expect(selector).to.equal(mySelector)
76
+ })
85
77
 
86
78
  it('should filter properties only by multiple params', () => {
87
79
  const myProps = {
88
- action: "CHANNEL_MYCHANNEL_MAIN_EVENT",
89
- myPropFn: (v)=>v>=30
80
+ action: 'CHANNEL_MYCHANNEL_MAIN_EVENT',
81
+ myPropFn: (v) => v >= 30
90
82
  }
91
- const cpFilter = new ChannelPayloadFilter(undefined ,myProps, 'myval', true);
92
- const myPropFn = R.path(['propFilters', 'myPropFn'], cpFilter);
93
- expect(myPropFn).to.be.a('function');
94
-
95
- });
83
+ const cpFilter = new ChannelPayloadFilter(undefined, myProps, 'myval', true)
84
+ const myPropFn = R.path(['propFilters', 'myPropFn'], cpFilter)
85
+ expect(myPropFn).to.be.a('function')
86
+ })
96
87
 
97
88
  it('should filter properties only one object param', () => {
98
89
  const myProps = {
99
- action: "CHANNEL_MYCHANNEL_MAIN_EVENT",
100
- myPropFn: (v)=>v>=30,
90
+ action: 'CHANNEL_MYCHANNEL_MAIN_EVENT',
91
+ myPropFn: (v) => v >= 30,
101
92
  testMode: testModeBool
102
93
  }
103
- const cpFilter = new ChannelPayloadFilter(myProps);
104
- const myPropFn = R.path(['propFilters', 'myPropFn'], cpFilter);
105
- expect(myPropFn).to.be.a('function');
106
-
107
- });
108
-
109
-
110
-
111
-
112
-
113
-
114
- });
115
-
116
-
117
- describe('should test channel payload filters boolean correctness', ()=>{
94
+ const cpFilter = new ChannelPayloadFilter(myProps)
95
+ const myPropFn = R.path(['propFilters', 'myPropFn'], cpFilter)
96
+ expect(myPropFn).to.be.a('function')
97
+ })
98
+ })
118
99
 
119
- const liSel = "#xqdlqmr";
120
- //const spyneApp = SpyneApp;
100
+ describe('should test channel payload filters boolean correctness', () => {
101
+ const liSel = '#xqdlqmr'
102
+ // const spyneApp = SpyneApp;
121
103
 
122
- beforeEach(function(){
123
- SpyneApp.init({debug:true}, true)
104
+ beforeEach(function() {
105
+ SpyneApp.init({ debug:true }, true)
124
106
 
125
107
  const liElTmpl = `
126
108
  <li class="page-card page-menu-4-card" id="xqdlqmr" name="PageCardView" data-vsid="xqdlqmr"><a href="/menu-3/sub-menu-4" data-channel="ROUTE" data-event-prevent-default="true" data-topic-id="sub-menu-2" data-nav-level="2">
@@ -133,114 +115,89 @@ describe('should test channel payload filters boolean correctness', ()=>{
133
115
  </dd>
134
116
  </dl>
135
117
  </li>
136
- `;
137
-
118
+ `
138
119
 
139
- const ul = document.createElement('ul');
140
- ul.innerHTML = liElTmpl;
141
- document.body.appendChild(ul);
120
+ const ul = document.createElement('ul')
121
+ ul.innerHTML = liElTmpl
122
+ document.body.appendChild(ul)
142
123
 
143
-
144
- ChannelPayloadToTestFilters.srcElement.el = document.querySelector(liSel);
124
+ ChannelPayloadToTestFilters.srcElement.el = document.querySelector(liSel)
145
125
  })
146
126
 
147
-
148
- it('should find the selector string ', ()=>{
149
- const cpFilter = new ChannelPayloadFilter(liSel);
150
- const payloadBool = cpFilter(ChannelPayloadToTestFilters);
151
- expect(payloadBool).to.be.true;
152
-
127
+ it('should find the selector string ', () => {
128
+ const cpFilter = new ChannelPayloadFilter(liSel)
129
+ const payloadBool = cpFilter(ChannelPayloadToTestFilters)
130
+ expect(payloadBool).to.be.true
153
131
  })
154
132
 
155
- it('should detect the wrong selector string ', ()=>{
156
- const cpFilter = new ChannelPayloadFilter("#mysel");
157
- const payloadBool = cpFilter(ChannelPayloadToTestFilters);
158
- expect(payloadBool).to.be.false;
159
-
133
+ it('should detect the wrong selector string ', () => {
134
+ const cpFilter = new ChannelPayloadFilter('#mysel')
135
+ const payloadBool = cpFilter(ChannelPayloadToTestFilters)
136
+ expect(payloadBool).to.be.false
160
137
  })
161
138
 
162
-
163
- it('should detect the selector from an array ', ()=>{
164
- const cpFilter = new ChannelPayloadFilter([liSel, 'ul', 'li.test']);
165
- const payloadBool = cpFilter(ChannelPayloadToTestFilters);
166
- expect(payloadBool).to.be.true;
167
-
139
+ it('should detect the selector from an array ', () => {
140
+ const cpFilter = new ChannelPayloadFilter([liSel, 'ul', 'li.test'])
141
+ const payloadBool = cpFilter(ChannelPayloadToTestFilters)
142
+ expect(payloadBool).to.be.true
168
143
  })
169
144
 
170
- it('should detect the wrong selector from an array ', ()=>{
171
- const cpFilter = new ChannelPayloadFilter(['dd', 'dt', 'ul', 'li.test']);
172
- const payloadBool = cpFilter(ChannelPayloadToTestFilters);
173
- expect(payloadBool).to.be.false;
174
-
145
+ it('should detect the wrong selector from an array ', () => {
146
+ const cpFilter = new ChannelPayloadFilter(['dd', 'dt', 'ul', 'li.test'])
147
+ const payloadBool = cpFilter(ChannelPayloadToTestFilters)
148
+ expect(payloadBool).to.be.false
175
149
  })
176
150
 
177
- it('should find the selector from filters', ()=>{
178
- const selector = liSel;
179
- const cpFilter = new ChannelPayloadFilter({selector});
180
- const payloadBool = cpFilter(ChannelPayloadToTestFilters);
151
+ it('should find the selector from filters', () => {
152
+ const selector = liSel
153
+ const cpFilter = new ChannelPayloadFilter({ selector })
154
+ const payloadBool = cpFilter(ChannelPayloadToTestFilters)
181
155
 
182
- expect(payloadBool).to.be.true;
156
+ expect(payloadBool).to.be.true
183
157
  })
184
158
 
185
-
186
- it('should detect the selector from an array in filters ', ()=>{
187
- const selector = ['dd', 'dt', 'ul',liSel, 'li.test'];
188
- const cpFilter = new ChannelPayloadFilter({selector});
189
- const payloadBool = cpFilter(ChannelPayloadToTestFilters);
190
- expect(payloadBool).to.be.true;
191
-
159
+ it('should detect the selector from an array in filters ', () => {
160
+ const selector = ['dd', 'dt', 'ul', liSel, 'li.test']
161
+ const cpFilter = new ChannelPayloadFilter({ selector })
162
+ const payloadBool = cpFilter(ChannelPayloadToTestFilters)
163
+ expect(payloadBool).to.be.true
192
164
  })
193
165
 
194
-
195
-
196
- it('should detect the selector from an array and destructured prop in filters ', ()=>{
197
- const selector = ['dd', 'dt', 'ul',liSel, 'li.test'];
198
- const pageId = (v)=>/menu-\d/.test(v);
199
- const cpFilter = new ChannelPayloadFilter({selector, pageId});
200
- const payloadBool = cpFilter(ChannelPayloadToTestFilters);
201
- expect(payloadBool).to.be.true;
202
-
203
-
166
+ it('should detect the selector from an array and destructured prop in filters ', () => {
167
+ const selector = ['dd', 'dt', 'ul', liSel, 'li.test']
168
+ const pageId = (v) => /menu-\d/.test(v)
169
+ const cpFilter = new ChannelPayloadFilter({ selector, pageId })
170
+ const payloadBool = cpFilter(ChannelPayloadToTestFilters)
171
+ expect(payloadBool).to.be.true
204
172
  })
205
173
 
206
- it('should detect the selector from an array and routeValue prop in filters ', ()=>{
207
- const selector = ['dd', 'dt', 'ul', liSel, 'li.test'];
208
- const re = /menu-\d/;
209
- const payload = R.compose(R.test(re), R.path(['routeData', 'pageId']));
210
- const cpFilter = new ChannelPayloadFilter({selector, payload});
211
- const payloadBool = cpFilter(ChannelPayloadToTestFilters);
212
- expect(payloadBool).to.be.true;
213
-
214
-
215
-
174
+ it('should detect the selector from an array and routeValue prop in filters ', () => {
175
+ const selector = ['dd', 'dt', 'ul', liSel, 'li.test']
176
+ const re = /menu-\d/
177
+ const payload = R.compose(R.test(re), R.path(['routeData', 'pageId']))
178
+ const cpFilter = new ChannelPayloadFilter({ selector, payload })
179
+ const payloadBool = cpFilter(ChannelPayloadToTestFilters)
180
+ expect(payloadBool).to.be.true
216
181
  })
217
182
 
218
- it('should detect the selector from an array and multiple props in filters ', ()=>{
219
- const selector = [liSel, 'dd', 'dt', 'ul', 'li.test'];
220
- const re = /menu-\d/;
221
- const action = "CHANNEL_ROUTE_CHANGE_EVENT";
222
- const payload = R.compose(R.test(re), R.path(['routeData', 'pageId']));
223
- const cpFilter = new ChannelPayloadFilter({selector, payload, action});
224
- const payloadBool = cpFilter(ChannelPayloadToTestFilters);
225
- expect(payloadBool).to.be.true;
226
-
227
- return true;
183
+ it('should detect the selector from an array and multiple props in filters ', () => {
184
+ const selector = [liSel, 'dd', 'dt', 'ul', 'li.test']
185
+ const re = /menu-\d/
186
+ const action = 'CHANNEL_ROUTE_CHANGE_EVENT'
187
+ const payload = R.compose(R.test(re), R.path(['routeData', 'pageId']))
188
+ const cpFilter = new ChannelPayloadFilter({ selector, payload, action })
189
+ const payloadBool = cpFilter(ChannelPayloadToTestFilters)
190
+ expect(payloadBool).to.be.true
228
191
 
192
+ return true
229
193
  })
230
-
231
-
232
-
233
-
234
-
235
194
  })
236
195
 
237
- describe('it should test channel payload filter with data packer ',()=>{
238
-
239
-
240
- const liSel = "#xqdlqmr";
196
+ describe('it should test channel payload filter with data packer ', () => {
197
+ const liSel = '#xqdlqmr'
241
198
 
242
- beforeEach(function(){
243
- SpyneApp.init({debug:true}, true)
199
+ beforeEach(function() {
200
+ SpyneApp.init({ debug:true }, true)
244
201
 
245
202
  const liElTmpl = `
246
203
  <li class="page-card page-menu-4-card" id="xqdlqmr" name="PageCardView" data-vsid="xqdlqmr"><a href="/menu-3/sub-menu-4" data-channel="ROUTE" data-event-prevent-default="true" data-topic-id="sub-menu-2" data-nav-level="2">
@@ -253,46 +210,29 @@ describe('it should test channel payload filter with data packer ',()=>{
253
210
  </dd>
254
211
  </dl>
255
212
  </li>
256
- `;
257
-
258
-
259
- const ul = document.createElement('ul');
260
- ul.innerHTML = liElTmpl;
261
- document.body.appendChild(ul);
213
+ `
262
214
 
215
+ const ul = document.createElement('ul')
216
+ ul.innerHTML = liElTmpl
217
+ document.body.appendChild(ul)
263
218
 
264
- ChannelPayloadToTestFilters.el = document.querySelector(liSel);
219
+ ChannelPayloadToTestFilters.el = document.querySelector(liSel)
265
220
  })
266
221
 
222
+ it('should test regular channel payload ', () => {
223
+ const { action, channelName, srcElement, payload } = ChannelPayloadToTestFilters
224
+ // console.log('spyne is is ',{action, channelName, srcElement, payload});
225
+ const re = /menu-\d/
226
+ const actionCompare = 'CHANNEL_ROUTE_CHANGE_EVENT'
227
+ const payloadCompare = R.compose(R.test(re), R.path(['routeData', 'pageId']))
228
+ const cpFilter = new ChannelPayloadFilter({ payload:payloadCompare, action:actionCompare })
267
229
 
230
+ const channelPayload = new ChannelPayload(channelName, action, payload, srcElement, {})
268
231
 
269
- it('should test regular channel payload ', ()=>{
270
-
271
-
272
-
273
- const {action, channelName, srcElement, payload} = ChannelPayloadToTestFilters;
274
- //console.log('spyne is is ',{action, channelName, srcElement, payload});
275
- const re = /menu-\d/;
276
- const actionCompare = "CHANNEL_ROUTE_CHANGE_EVENT";
277
- const payloadCompare = R.compose(R.test(re), R.path(['routeData', 'pageId']));
278
- const cpFilter = new ChannelPayloadFilter({payload:payloadCompare, action:actionCompare});
279
-
280
-
281
-
282
- const channelPayload = new ChannelPayload(channelName, action, payload, srcElement, {});
232
+ const payloadBool = cpFilter(channelPayload)
283
233
 
284
- const payloadBool = cpFilter(channelPayload);
285
-
286
- //console.log('payload bool base is ',payloadBool);
287
-
288
- return true;
234
+ // console.log('payload bool base is ',payloadBool);
289
235
 
236
+ return true
290
237
  })
291
-
292
-
293
-
294
-
295
-
296
-
297
-
298
238
  })