spyne 0.19.1 → 0.20.1

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 (132) hide show
  1. package/.eslintignore +2 -0
  2. package/.eslintrc.js +4 -3
  3. package/.travis.yml +24 -11
  4. package/karma.conf.js +77 -87
  5. package/lib/spyne.esm.js +15 -0
  6. package/lib/spyne.esm.js.map +1 -0
  7. package/lib/spyne.js +248 -248
  8. package/lib/spyne.umd.js +3 -0
  9. package/lib/spyne.umd.js.LICENSE.txt +16 -0
  10. package/package.json +48 -27
  11. package/rollup.config.js +26 -0
  12. package/src/spyne/channels/channel-fetch-class.js +39 -43
  13. package/src/spyne/channels/channel-payload-class.js +61 -74
  14. package/src/spyne/channels/channel-proxy.js +25 -26
  15. package/src/spyne/channels/channel.js +141 -149
  16. package/src/spyne/channels/channels-config.js +46 -47
  17. package/src/spyne/channels/channels-map.js +61 -65
  18. package/src/spyne/channels/spyne-channel-lifecycle.js +12 -12
  19. package/src/spyne/channels/spyne-channel-route.js +241 -250
  20. package/src/spyne/channels/spyne-channel-ui.js +213 -75
  21. package/src/spyne/channels/spyne-channel-window.js +157 -157
  22. package/src/spyne/spyne-app.js +32 -19
  23. package/src/spyne/spyne-plugins.js +55 -70
  24. package/src/spyne/spyne.js +23 -23
  25. package/src/spyne/utils/channel-config-validator.js +10 -10
  26. package/src/spyne/utils/channel-fetch-util.js +72 -55
  27. package/src/spyne/utils/channel-payload-filter.js +89 -100
  28. package/src/spyne/utils/deep-merge.js +31 -29
  29. package/src/spyne/utils/frp-tools.js +108 -92
  30. package/src/spyne/utils/gc.js +6 -6
  31. package/src/spyne/utils/mixins/base-core-mixins.js +17 -15
  32. package/src/spyne/utils/mixins/base-streams-mixins.js +9 -9
  33. package/src/spyne/utils/route-channel-updater.js +23 -29
  34. package/src/spyne/utils/safe-clone.js +40 -58
  35. package/src/spyne/utils/sanitize-html.js +35 -0
  36. package/src/spyne/utils/security-policy.js +11 -0
  37. package/src/spyne/utils/spyne-app-properties.js +110 -114
  38. package/src/spyne/utils/spyne-logger.js +4 -11
  39. package/src/spyne/utils/spyne-plugins-methods.js +38 -63
  40. package/src/spyne/utils/spyne-trait.js +33 -33
  41. package/src/spyne/utils/spyne-utils-channel-route-url.js +229 -153
  42. package/src/spyne/utils/spyne-utils-channel-route.js +128 -138
  43. package/src/spyne/utils/spyne-utils-channel-window.js +39 -39
  44. package/src/spyne/utils/viewstream-animations.js +12 -12
  45. package/src/spyne/utils/viewstream-observables.js +45 -45
  46. package/src/spyne/views/dom-element-template.js +111 -114
  47. package/src/spyne/views/dom-element.js +82 -84
  48. package/src/spyne/views/view-stream-broadcaster.js +66 -62
  49. package/src/spyne/views/view-stream-element.js +105 -106
  50. package/src/spyne/views/view-stream-payload.js +25 -27
  51. package/src/spyne/views/view-stream-selector.js +157 -163
  52. package/src/spyne/views/view-stream.js +416 -640
  53. package/src/tests/channels/channel-dom.test.js +15 -15
  54. package/src/tests/channels/channel-fetch.test.js +51 -62
  55. package/src/tests/channels/channel-payload-class.test.js +50 -63
  56. package/src/tests/channels/channel-payload-filter.test.js +133 -193
  57. package/src/tests/channels/channel-route.test.js +102 -112
  58. package/src/tests/channels/channel-stream-item.test.js +19 -19
  59. package/src/tests/channels/channel-ui.test.js +15 -27
  60. package/src/tests/channels/channel-util-dom.test.js +31 -31
  61. package/src/tests/channels/channel.test.js +20 -25
  62. package/src/tests/channels/route-utils.test.js +61 -66
  63. package/src/tests/channels/url-utils.test.js +151 -151
  64. package/src/tests/channels/view-stream-broadcaster.test.js +7 -7
  65. package/src/tests/import.test.js +5 -5
  66. package/src/tests/index.js +6 -7
  67. package/src/tests/index.test.js +6 -8
  68. package/src/tests/mocks/channel-payload-data.js +218 -220
  69. package/src/tests/mocks/enhancer.test.js +5 -5
  70. package/src/tests/mocks/payload-ui.js +87 -90
  71. package/src/tests/mocks/routes-data.js +264 -266
  72. package/src/tests/mocks/spyne-docs.mocks.js +3 -3
  73. package/src/tests/mocks/template-renderer.mocks.js +47 -47
  74. package/src/tests/mocks/utils-data.js +78 -79
  75. package/src/tests/mocks/viewstream-internal-payload.mocks.js +50 -50
  76. package/src/tests/mocks/window-events-arr.js +1 -1
  77. package/src/tests/package-json.spec.test.js +9 -0
  78. package/src/tests/spyne-app.test.js +15 -18
  79. package/src/tests/spyne-plugin.test.js +16 -20
  80. package/src/tests/utils/channel-action-filter.test.js +84 -86
  81. package/src/tests/utils/channel-data-packet-generator.unused.js +62 -86
  82. package/src/tests/utils/channel-fetch-util.test.js +64 -66
  83. package/src/tests/utils/frp-tools.test.js +19 -19
  84. package/src/tests/utils/plugins-methods.test.js +31 -55
  85. package/src/tests/utils/security.test.js +10 -0
  86. package/src/tests/utils/spyne-app-properties.test.js +4 -8
  87. package/src/tests/views/dom-el-selectors.test.js +112 -119
  88. package/src/tests/views/dom-el-template-proxy.test.js +7 -0
  89. package/src/tests/views/dom-el-template.test.js +186 -156
  90. package/src/tests/views/dom-el.test.js +58 -56
  91. package/src/tests/views/view-stream-enhancer-loader.test.js +2 -2
  92. package/src/tests/views/view-stream-enhancer.test.js +11 -11
  93. package/src/tests/views/view-stream.test.js +22 -33
  94. package/webpack.config.js +76 -67
  95. package/docs/-_%20Solves%20equations%20of%20the%20form%20a%20_%20x%20=%20b.html +0 -487
  96. package/docs/DomItem.html +0 -298
  97. package/docs/DomItem_DomItem.html +0 -314
  98. package/docs/ViewStream.html +0 -2249
  99. package/docs/ViewStream_ViewStream.html +0 -503
  100. package/docs/custom/css/jsdoc-viewstream.css +0 -377
  101. package/docs/custom/layout.tmpl +0 -47
  102. package/docs/dom-item.js.html +0 -213
  103. package/docs/fonts/OpenSans-Bold-webfont.eot +0 -0
  104. package/docs/fonts/OpenSans-Bold-webfont.svg +0 -1830
  105. package/docs/fonts/OpenSans-Bold-webfont.woff +0 -0
  106. package/docs/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
  107. package/docs/fonts/OpenSans-BoldItalic-webfont.svg +0 -1830
  108. package/docs/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
  109. package/docs/fonts/OpenSans-Italic-webfont.eot +0 -0
  110. package/docs/fonts/OpenSans-Italic-webfont.svg +0 -1830
  111. package/docs/fonts/OpenSans-Italic-webfont.woff +0 -0
  112. package/docs/fonts/OpenSans-Light-webfont.eot +0 -0
  113. package/docs/fonts/OpenSans-Light-webfont.svg +0 -1831
  114. package/docs/fonts/OpenSans-Light-webfont.woff +0 -0
  115. package/docs/fonts/OpenSans-LightItalic-webfont.eot +0 -0
  116. package/docs/fonts/OpenSans-LightItalic-webfont.svg +0 -1835
  117. package/docs/fonts/OpenSans-LightItalic-webfont.woff +0 -0
  118. package/docs/fonts/OpenSans-Regular-webfont.eot +0 -0
  119. package/docs/fonts/OpenSans-Regular-webfont.svg +0 -1831
  120. package/docs/fonts/OpenSans-Regular-webfont.woff +0 -0
  121. package/docs/global.html +0 -548
  122. package/docs/index-custom.html +0 -79
  123. package/docs/index.html +0 -82
  124. package/docs/jsdoc.config.json +0 -22
  125. package/docs/scripts/linenumber.js +0 -25
  126. package/docs/scripts/prettify/Apache-License-2.0.txt +0 -202
  127. package/docs/scripts/prettify/lang-css.js +0 -2
  128. package/docs/scripts/prettify/prettify.js +0 -28
  129. package/docs/styles/jsdoc-default.css +0 -358
  130. package/docs/styles/prettify-jsdoc.css +0 -111
  131. package/docs/styles/prettify-tomorrow.css +0 -132
  132. package/docs/view-stream.js.html +0 -767
@@ -1,17 +1,14 @@
1
- const {expect, assert} = require('chai');
2
- import {SpynePluginsMethods} from '../../spyne/utils/spyne-plugins-methods';
3
-
4
-
5
-
6
- const spynePluginMethods = new SpynePluginsMethods();
1
+ import { SpynePluginsMethods } from '../../spyne/utils/spyne-plugins-methods'
2
+ const { expect, assert } = require('chai')
7
3
 
4
+ const spynePluginMethods = new SpynePluginsMethods()
8
5
 
9
6
  const methodsObj = {
10
- myFn1: ()=>{
7
+ myFn1: () => {
11
8
  return 'first method value'
12
9
  },
13
10
 
14
- myFn2: ()=>{
11
+ myFn2: () => {
15
12
  return 'second method vaue'
16
13
  }
17
14
 
@@ -19,85 +16,64 @@ const methodsObj = {
19
16
 
20
17
  const dupeMethods = {
21
18
 
22
- myFn1: ()=>{
19
+ myFn1: () => {
23
20
  return 'this is a dupe method'
24
21
  },
25
22
 
26
- myFn4: ()=>{
23
+ myFn4: () => {
27
24
  return 'second method vaue'
28
25
  }
29
26
 
30
-
31
-
32
27
  }
33
28
 
34
-
35
29
  const methodsObjWrong = {
36
- myStr1: "This should be a valid method.",
30
+ myStr1: 'This should be a valid method.',
37
31
 
38
- myFn3: ()=>{
32
+ myFn3: () => {
39
33
  return 'second method vaue'
40
34
  }
41
35
  }
42
36
 
43
-
44
-
45
-
46
37
  const methodsArr = [
47
38
  {
48
- myFn1: ()=>{
39
+ myFn1: () => {
49
40
  return 'first method value'
50
41
  }
51
42
  }
52
43
  ]
53
44
 
54
-
55
-
56
- //console.log('plugin methods1 is ',{spynePluginMethods})
45
+ // console.log('plugin methods1 is ',{spynePluginMethods})
57
46
 
58
47
  describe('should test spyne plugins methods', () => {
59
-
60
48
  it('should test that SpynePluginsMethods exists', () => {
61
-
62
- expect(spynePluginMethods).to.exist;
63
-
64
- });
65
-
66
- it('should get the plugin object', ()=>{
67
- const pluginsMethodObj = spynePluginMethods.pluginMethodsObj
68
- expect(pluginsMethodObj).to.be.an('object');
69
-
49
+ expect(spynePluginMethods).to.exist
70
50
  })
71
51
 
72
- it('should check if methodsObj is valid obj', ()=>{
73
- const warnStr = spynePluginMethods.addMethods(methodsArr, true);
74
- expect(warnStr).to.be.a('string');
52
+ it('should get the plugin object', () => {
53
+ const pluginsMethodObj = spynePluginMethods.pluginMethodsObj
54
+ expect(pluginsMethodObj).to.be.an('object')
75
55
  })
76
56
 
77
- it('should return error for non method vals', ()=>{
78
- const warnStr = spynePluginMethods.addMethods(methodsObjWrong, true);
79
- expect(warnStr).to.be.a('string');
57
+ it('should check if methodsObj is valid obj', () => {
58
+ const warnStr = spynePluginMethods.addMethods(methodsArr, true)
59
+ expect(warnStr).to.be.a('string')
80
60
  })
81
61
 
82
-
83
-
84
- it('should add methods from key value pairs', ()=>{
85
-
86
- spynePluginMethods.addMethods(methodsObj);
87
-
88
- const pluginMethodsObj = spynePluginMethods.pluginMethodsObj;
89
- const firstMethodVal =pluginMethodsObj.myFn1()
90
- expect(firstMethodVal).to.equal(methodsObj.myFn1());
91
-
62
+ it('should return error for non method vals', () => {
63
+ const warnStr = spynePluginMethods.addMethods(methodsObjWrong, true)
64
+ expect(warnStr).to.be.a('string')
92
65
  })
93
66
 
67
+ it('should add methods from key value pairs', () => {
68
+ spynePluginMethods.addMethods(methodsObj)
94
69
 
95
- it('should capture already created methods', ()=>{
96
-
97
- const warnStr = spynePluginMethods.addMethods(dupeMethods, true);
98
- expect(warnStr).to.be.a('string');
99
-
70
+ const pluginMethodsObj = spynePluginMethods.pluginMethodsObj
71
+ const firstMethodVal = pluginMethodsObj.myFn1()
72
+ expect(firstMethodVal).to.equal(methodsObj.myFn1())
100
73
  })
101
74
 
102
-
103
- });
75
+ it('should capture already created methods', () => {
76
+ const warnStr = spynePluginMethods.addMethods(dupeMethods, true)
77
+ expect(warnStr).to.be.a('string')
78
+ })
79
+ })
@@ -0,0 +1,10 @@
1
+ const {
2
+ expect,
3
+ assert
4
+ } = require('chai')
5
+
6
+ describe('root test', () => {
7
+ it('should run shell tests', () => {
8
+ return true
9
+ })
10
+ })
@@ -1,11 +1,7 @@
1
- const {expect, assert} = require('chai');
1
+ const { expect, assert } = require('chai')
2
2
 
3
3
  describe('root test', () => {
4
-
5
4
  it('should run shell tests', () => {
6
-
7
- return true;
8
-
9
- });
10
-
11
- });
5
+ return true
6
+ })
7
+ })
@@ -1,148 +1,141 @@
1
- import { spyneDocsDomStr } from '../mocks/spyne-docs.mocks';
2
- import { ViewStreamSelector } from '../../spyne/views/view-stream-selector';
1
+ import { spyneDocsDomStr } from '../mocks/spyne-docs.mocks'
2
+ import { ViewStreamSelector } from '../../spyne/views/view-stream-selector'
3
3
 
4
- import * as R from 'ramda';
4
+ import * as R from 'ramda'
5
5
 
6
6
  describe('Dom Item Selector', () => {
7
7
  beforeEach(function() {
8
- document.body.insertAdjacentHTML('afterbegin', spyneDocsDomStr);
8
+ document.body.insertAdjacentHTML('afterbegin', spyneDocsDomStr)
9
9
  }
10
- );
10
+ )
11
11
 
12
12
  // remove the html fixture from the DOM
13
13
  afterEach(function() {
14
- document.body.removeChild(document.getElementById('app'));
15
- });
16
-
17
- it('should return the same el', ()=>{
18
- let el = document.querySelector("ul#my-list");
19
- let elNode = ViewStreamSelector(el);
20
- let elNodesEqual = el.isEqualNode(elNode.el);
21
- expect(elNodesEqual).to.eq(true);
22
- });
23
-
24
- it('should return array containing the same el', ()=>{
25
- let el = document.querySelector('body');
26
- let liSelStr = "ul#my-list";
27
- let listEl = document.querySelector(liSelStr);
28
- let elNode = ViewStreamSelector(el,liSelStr).arr;
29
- let elNodesEqual = listEl.isEqualNode(elNode[0]);
30
- expect(elNodesEqual).to.eq(true);
31
- });
32
-
33
-
34
-
35
- it('should return the same el from selector', ()=>{
36
- let el = document.querySelector("ul#my-list");
37
- let el$ = ViewStreamSelector("ul#my-list");
38
- let elNodesEqual = el.isEqualNode(el$.el);
39
- expect(elNodesEqual).to.eq(true);
40
- });
41
-
14
+ document.body.removeChild(document.getElementById('app'))
15
+ })
16
+
17
+ it('should return the same el', () => {
18
+ const el = document.querySelector('ul#my-list')
19
+ const elNode = ViewStreamSelector(el)
20
+ const elNodesEqual = el.isEqualNode(elNode.el)
21
+ expect(elNodesEqual).to.eq(true)
22
+ })
23
+
24
+ it('should return array containing the same el', () => {
25
+ const el = document.querySelector('body')
26
+ const liSelStr = 'ul#my-list'
27
+ const listEl = document.querySelector(liSelStr)
28
+ const elNode = ViewStreamSelector(el, liSelStr).arr
29
+ const elNodesEqual = listEl.isEqualNode(elNode[0])
30
+ expect(elNodesEqual).to.eq(true)
31
+ })
32
+
33
+ it('should return the same el from selector', () => {
34
+ const el = document.querySelector('ul#my-list')
35
+ const el$ = ViewStreamSelector('ul#my-list')
36
+ const elNodesEqual = el.isEqualNode(el$.el)
37
+ expect(elNodesEqual).to.eq(true)
38
+ })
42
39
 
43
40
  it('should return local li', () => {
44
- let el = document.querySelector("ul#my-list");
45
- let el$ = ViewStreamSelector("ul#my-list");
46
- let liList = el$('li');
47
- expect(liList.el.length).to.eq(5);
48
- });
41
+ const el = document.querySelector('ul#my-list')
42
+ const el$ = ViewStreamSelector('ul#my-list')
43
+ const liList = el$('li')
44
+ expect(liList.el.length).to.eq(5)
45
+ })
49
46
  it('should add class to li', () => {
50
- let el = document.querySelector("ul#my-list");
51
- let el$ = ViewStreamSelector("ul#my-list");
52
- let liList = el$('li');
53
- liList.addClass('foo');
54
- let hasFooClassBool = liList.el[0].classList.contains('foo');
55
- expect(hasFooClassBool).to.eq(true);
56
- });
47
+ const el = document.querySelector('ul#my-list')
48
+ const el$ = ViewStreamSelector('ul#my-list')
49
+ const liList = el$('li')
50
+ liList.addClass('foo')
51
+ const hasFooClassBool = liList.el[0].classList.contains('foo')
52
+ expect(hasFooClassBool).to.eq(true)
53
+ })
57
54
 
58
55
  it('should remove class to li', () => {
59
- let el = document.querySelector("ul#my-list");
60
- let el$ = ViewStreamSelector("ul#my-list");
61
- let liList = el$('li');
62
- liList.removeClass('has-svg');
63
- let hasSvgClassBool = liList.el[0].classList.contains('has-svg');
64
- expect(hasSvgClassBool).to.eq(false);
65
- });
66
-
56
+ const el = document.querySelector('ul#my-list')
57
+ const el$ = ViewStreamSelector('ul#my-list')
58
+ const liList = el$('li')
59
+ liList.removeClass('has-svg')
60
+ const hasSvgClassBool = liList.el[0].classList.contains('has-svg')
61
+ expect(hasSvgClassBool).to.eq(false)
62
+ })
67
63
 
68
64
  it('should set class foo bar', () => {
69
- let el = document.querySelector("ul#my-list");
70
- let el$ = ViewStreamSelector("ul#my-list");
71
- let liList = el$('li');
72
- liList.setClass('foo bar');
73
- //console.log('liList ',liList.el[0].className)
74
- let isFooBarClassBool = liList.el[0].className === 'foo bar';
75
- expect(isFooBarClassBool).to.eq(true);
76
- });
77
-
65
+ const el = document.querySelector('ul#my-list')
66
+ const el$ = ViewStreamSelector('ul#my-list')
67
+ const liList = el$('li')
68
+ liList.setClass('foo bar')
69
+ // console.log('liList ',liList.el[0].className)
70
+ const isFooBarClassBool = liList.el[0].className === 'foo bar'
71
+ expect(isFooBarClassBool).to.eq(true)
72
+ })
78
73
 
79
74
  it('should add inline css', () => {
80
- let el = document.querySelector("ul#my-list");
81
- let el$ = ViewStreamSelector("ul#my-list");
82
- let liList = el$('li');
83
- liList.inlineCss = 'background:orange;';
84
- let backgroundSetBool = liList.el[0].style.getPropertyValue('background') === 'orange';
85
- expect(backgroundSetBool).to.eq(true);
86
- });
75
+ const el = document.querySelector('ul#my-list')
76
+ const el$ = ViewStreamSelector('ul#my-list')
77
+ const liList = el$('li')
78
+ liList.inlineCss = 'background:orange;'
79
+ const backgroundSetBool = liList.el[0].style.getPropertyValue('background') === 'orange'
80
+ expect(backgroundSetBool).to.eq(true)
81
+ })
87
82
 
88
83
  it('should add toogle Class', () => {
89
- let el = document.querySelector("ul#my-list");
90
- let el$ = ViewStreamSelector("ul#my-list");
91
- let liList = el$('li');
92
- liList.toggleClass('foo', true);
93
- let hasFooClassBool = liList.el[0].classList.contains('foo');
94
- expect(hasFooClassBool).to.eq(true);
95
- });
84
+ const el = document.querySelector('ul#my-list')
85
+ const el$ = ViewStreamSelector('ul#my-list')
86
+ const liList = el$('li')
87
+ liList.toggleClass('foo', true)
88
+ const hasFooClassBool = liList.el[0].classList.contains('foo')
89
+ expect(hasFooClassBool).to.eq(true)
90
+ })
96
91
 
97
92
  it('should toggle based on el selector', () => {
98
- let el = document.querySelector("ul#my-list");
99
- let el$ = ViewStreamSelector("ul#my-list");
100
- let el1 = el.querySelector('li:nth-child(1)');
101
- let liList = el$('li');
102
- liList.setActiveItem('bar', 'li:nth-child(1)');
103
- let hasBarClassBool = el1.classList.contains('bar');
104
- expect(hasBarClassBool).to.eq(true);
105
- });
93
+ const el = document.querySelector('ul#my-list')
94
+ const el$ = ViewStreamSelector('ul#my-list')
95
+ const el1 = el.querySelector('li:nth-child(1)')
96
+ const liList = el$('li')
97
+ liList.setActiveItem('bar', 'li:nth-child(1)')
98
+ const hasBarClassBool = el1.classList.contains('bar')
99
+ expect(hasBarClassBool).to.eq(true)
100
+ })
106
101
 
107
102
  it('should toggle based on element', () => {
108
- let el = document.querySelector("ul#my-list");
109
- let el$ = ViewStreamSelector("ul#my-list");
110
- let el1 = el.querySelector('li:nth-child(1)');
111
- let liList = el$('li');
112
- liList.setActiveItem('bar', el1);
113
- let hasBarClassBool = el1.classList.contains('bar');
114
- expect(hasBarClassBool).to.eq(true);
115
- });
103
+ const el = document.querySelector('ul#my-list')
104
+ const el$ = ViewStreamSelector('ul#my-list')
105
+ const el1 = el.querySelector('li:nth-child(1)')
106
+ const liList = el$('li')
107
+ liList.setActiveItem('bar', el1)
108
+ const hasBarClassBool = el1.classList.contains('bar')
109
+ expect(hasBarClassBool).to.eq(true)
110
+ })
116
111
 
117
112
  it('should setActiveItem based on el selector', () => {
118
- let el = document.querySelector("ul#my-list");
119
- let el$ = ViewStreamSelector("ul#my-list");
120
- let el1 = el.querySelector('li:nth-child(1)');
121
- let liList = el$('li');
122
- liList.setActiveItem('bar','li:nth-child(1)');
123
- let hasBarClassBool = el1.classList.contains('bar');
124
- expect(hasBarClassBool).to.eq(true);
125
- });
113
+ const el = document.querySelector('ul#my-list')
114
+ const el$ = ViewStreamSelector('ul#my-list')
115
+ const el1 = el.querySelector('li:nth-child(1)')
116
+ const liList = el$('li')
117
+ liList.setActiveItem('bar', 'li:nth-child(1)')
118
+ const hasBarClassBool = el1.classList.contains('bar')
119
+ expect(hasBarClassBool).to.eq(true)
120
+ })
126
121
 
127
122
  it('should check selector for node', () => {
128
- let el = document.querySelector("ul#my-list");
129
- let el$ = ViewStreamSelector("ul#my-list");
130
- let el1 = el.querySelector('li:nth-child(1)');
131
- let liList = el$('li');
132
- liList.setActiveItem('bar','li:nth-child(5)');
133
- let hasBarClassBool = el1.classList.contains('bar');
134
- expect(hasBarClassBool).to.eq(false);
135
- });
123
+ const el = document.querySelector('ul#my-list')
124
+ const el$ = ViewStreamSelector('ul#my-list')
125
+ const el1 = el.querySelector('li:nth-child(1)')
126
+ const liList = el$('li')
127
+ liList.setActiveItem('bar', 'li:nth-child(5)')
128
+ const hasBarClassBool = el1.classList.contains('bar')
129
+ expect(hasBarClassBool).to.eq(false)
130
+ })
136
131
 
137
132
  it('should setActiveItem based on el', () => {
138
- let el = document.querySelector("ul#my-list");
139
- let el$ = ViewStreamSelector("ul#my-list");
140
- let el1 = el.querySelector('li:nth-child(1)');
141
- let liList = el$('li');
142
- liList.setActiveItem('bar',el1);
143
- let hasBarClassBool = el1.classList.contains('bar');
144
- expect(hasBarClassBool).to.eq(true);
145
- });
146
-
147
-
148
- });
133
+ const el = document.querySelector('ul#my-list')
134
+ const el$ = ViewStreamSelector('ul#my-list')
135
+ const el1 = el.querySelector('li:nth-child(1)')
136
+ const liList = el$('li')
137
+ liList.setActiveItem('bar', el1)
138
+ const hasBarClassBool = el1.classList.contains('bar')
139
+ expect(hasBarClassBool).to.eq(true)
140
+ })
141
+ })
@@ -0,0 +1,7 @@
1
+ import { DomElementTemplate } from '../../spyne/views/dom-element-template'
2
+
3
+ describe('DomElementTemplate Proxy should not exist ', () => {
4
+ it('should not have a proxy method', () => {
5
+ expect(DomElementTemplate.hasOwnProperty('formatTemplateForProxyData')).to.be.false
6
+ })
7
+ })