Precise DOM morphing
morphing typescript dom
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'main' of https://github.com/joeldrapper/morphlite

+24
+24
test/something.test.js
··· 578 578 expect(a.outerHTML).to.equal(b.outerHTML); 579 579 }); 580 580 }); 581 + 582 + it("should replace nodes", async () => { 583 + const a = await fixture(html`<ul><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li></ul>`); 584 + const b = await fixture(html`<ul><div>1</div><li>2</li><p>3</p><li>4</li><li>5</li></ul>`); 585 + 586 + morph(a, b); 587 + 588 + expect(a.outerHTML).to.equal(b.outerHTML); 589 + }) 590 + 591 + it("should replace nodes after multiple iterations", async () => { 592 + const a = await fixture(html`<ul></ul>`); 593 + const b = await fixture(html`<ul><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li></ul>`); 594 + 595 + morph(a, b); 596 + 597 + expect(a.outerHTML).to.equal(b.outerHTML); 598 + 599 + const c = await fixture(html`<ul><div>1</div><li>2</li><p>3</p><li>4</li><li>5</li></ul>`); 600 + 601 + morph(a, c); 602 + 603 + expect(a.outerHTML).to.equal(c.outerHTML); 604 + }) 581 605 });