@knowark/componarkjs 1.9.2 → 1.10.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.
|
@@ -34,6 +34,14 @@ class MockComponent extends Component {
|
|
|
34
34
|
}
|
|
35
35
|
Component.define('mock-component', MockComponent)
|
|
36
36
|
|
|
37
|
+
class MockContentComponent extends Component {
|
|
38
|
+
render () {
|
|
39
|
+
this.content = '<p>MOCK_CONTENT</p>'
|
|
40
|
+
return super.render()
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
Component.define('mock-content-component', MockContentComponent)
|
|
44
|
+
|
|
37
45
|
describe('Component', () => {
|
|
38
46
|
let container = null
|
|
39
47
|
let component = null
|
|
@@ -7,7 +7,7 @@ export class List extends Component {
|
|
|
7
7
|
constructor () {
|
|
8
8
|
super()
|
|
9
9
|
this.addEventListener('click', this._onSelected.bind(this))
|
|
10
|
-
this.addEventListener('delete', this.
|
|
10
|
+
this.addEventListener('delete', this._onDeleted.bind(this))
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
/** @param {Object} context */
|
|
@@ -84,7 +84,7 @@ export class List extends Component {
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
/** @param {MouseEvent} event */
|
|
87
|
-
|
|
87
|
+
_onDeleted (event) {
|
|
88
88
|
event.stopImmediatePropagation()
|
|
89
89
|
|
|
90
90
|
const target = /** @type {HTMLElement} */ (event.target)
|
|
@@ -241,8 +241,7 @@ describe('List', () => {
|
|
|
241
241
|
<template>
|
|
242
242
|
<span>
|
|
243
243
|
<strong>\${this}</strong></span>
|
|
244
|
-
<button data-\${this}
|
|
245
|
-
new CustomEvent('delete', { bubbles: true }))">
|
|
244
|
+
<button data-\${this}>
|
|
246
245
|
DELETE
|
|
247
246
|
</button>
|
|
248
247
|
</template>
|
|
@@ -254,7 +253,7 @@ describe('List', () => {
|
|
|
254
253
|
let items = list.selectAll('ark-list-item')
|
|
255
254
|
expect(items.length).toEqual(4)
|
|
256
255
|
|
|
257
|
-
button.
|
|
256
|
+
button.dispatchEvent(new CustomEvent('delete', { bubbles: true }))
|
|
258
257
|
|
|
259
258
|
button = list.querySelector('[data-colombia]')
|
|
260
259
|
items = list.selectAll('ark-list-item')
|