File tree Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Original file line number Diff line number Diff line change
1
+ import {
2
+ htmlToElement ,
3
+ } from '../src/dom_utils' ;
4
+ import { DiffDOM } from "diff-dom"
5
+
6
+ describe ( 'diff-dom' , ( ) => {
7
+ it ( 'Just playing' , ( ) => {
8
+
9
+
10
+ const dd = new DiffDOM ( ) ;
11
+
12
+ const from = htmlToElement ( `
13
+ <div>
14
+ Text at the top
15
+ <div class="child-element">Child1 text</div>
16
+ <div>between</div>
17
+ <div class="child-element">Child2 text<span class="foo">icon</span></div>
18
+ </div>
19
+ ` )
20
+
21
+ const to = htmlToElement ( `
22
+ <div>
23
+ Text at the top
24
+ <div class="child-element">Child1 text</div>
25
+ <div>between</div>
26
+ <div class="child-element">Child2 text</div>
27
+ </div>
28
+ ` )
29
+
30
+ const diff = dd . diff ( from , to )
31
+ console . log ( diff ) ;
32
+ } ) ;
33
+ } ) ;
Original file line number Diff line number Diff line change @@ -439,7 +439,7 @@ of the change:
439
439
const rootElement = document .getElementById (' favorite-food' );
440
440
input .value = ' sushi' ;
441
441
442
- element .dispatchEvent (new Event (' change' , { bubbles: true }));
442
+ input .dispatchEvent (new Event (' change' , { bubbles: true }));
443
443
444
444
JavaScript Component Hooks
445
445
~~~~~~~~~~~~~~~~~~~~~~~~~~
You can’t perform that action at this time.
0 commit comments