···267267 expect(a.value).to.equal("hi");
268268 });
269269 });
270270+271271+ describe("boolean properties", () => {
272272+ describe("checked", () => {
273273+ it("if new tree has no checked and old tree does, remove value", async () => {
274274+ const a = await fixture(html`<input type="checkbox" checked=${true} />`);
275275+ const b = await fixture(html`<input type="checkbox" />`);
276276+277277+ morph(a, b);
278278+279279+ expect(a.outerHTML).to.equal(b.outerHTML);
280280+ expect(a.checked).to.equal(false);
281281+ });
282282+283283+ it("if new tree has checked and old tree does not, add value", async () => {
284284+ const a = await fixture(html`<input type="checkbox" />`);
285285+ const b = await fixture(html`<input type="checkbox" checked=${true} />`);
286286+287287+ morph(a, b);
288288+289289+ expect(a.outerHTML).to.equal(b.outerHTML);
290290+ expect(a.checked).to.equal(true);
291291+ });
292292+293293+ it("if new tree has checked=false and old tree has checked=true, set value from new tree", async () => {
294294+ const a = await fixture(html`<input type="checkbox" checked=${false} />`);
295295+ const b = await fixture(html`<input type="checkbox" checked=${true} />`);
296296+297297+ morph(a, b);
298298+299299+ expect(a.outerHTML).to.equal(b.outerHTML);
300300+ expect(a.checked).to.equal(true);
301301+ });
302302+303303+ it("if new tree has checked=true and old tree has checked=false, set value from new tree", async () => {
304304+ const a = await fixture(html`<input type="checkbox" checked=${true} />`);
305305+ const b = await fixture(html`<input type="checkbox" checked=${false} />`);
306306+307307+ morph(a, b);
308308+309309+ expect(a.outerHTML).to.equal(b.outerHTML);
310310+ expect(a.checked).to.equal(false);
311311+ });
312312+313313+ it("if new tree has no checked and old tree has checked mutated to true, set value from new tree", async () => {
314314+ const a = await fixture(html`<input type="checkbox" />`);
315315+ const b = await fixture(html`<input type="checkbox" />`);
316316+ b.checked = true;
317317+318318+ morph(a, b);
319319+320320+ expect(a.outerHTML).to.equal(b.outerHTML);
321321+ expect(a.checked).to.equal(true);
322322+ });
323323+324324+ it("if new tree has checked=false and old tree has checked mutated to true, set value from new tree", async () => {
325325+ const a = await fixture(html`<input type="checkbox" checked=${false} />`);
326326+ const b = await fixture(html`<input type="checkbox" />`);
327327+ b.checked = true;
328328+329329+ morph(a, b);
330330+331331+ expect(a.outerHTML).to.equal(b.outerHTML);
332332+ expect(a.checked).to.equal(true);
333333+ });
334334+335335+ it("if new tree has checked=true and old tree has checked mutated to false, set value from new tree", async () => {
336336+ const a = await fixture(html`<input type="checkbox" checked=${true} />`);
337337+ const b = await fixture(html`<input type="checkbox" />`);
338338+ b.checked = false;
339339+340340+ morph(a, b);
341341+342342+ expect(a.outerHTML).to.equal(b.outerHTML);
343343+ expect(a.checked).to.equal(false);
344344+ });
345345+346346+ it("if new tree has no checked and old tree has checked=true, set value from new tree", async () => {
347347+ const a = await fixture(html`<input type="checkbox" />`);
348348+ const b = await fixture(html`<input type="checkbox" checked=${true} />`);
349349+350350+ morph(a, b);
351351+352352+ expect(a.outerHTML).to.equal(b.outerHTML);
353353+ expect(a.checked).to.equal(true);
354354+ });
355355+ });
356356+357357+ describe("disabled", () => {
358358+ it("if new tree has no disabled and old tree does, remove value", async () => {
359359+ const a = await fixture(html`<input type="checkbox" disabled=${true} />`);
360360+ const b = await fixture(html`<input type="checkbox" />`);
361361+362362+ morph(a, b);
363363+364364+ expect(a.outerHTML).to.equal(b.outerHTML);
365365+ expect(a.disabled).to.equal(false);
366366+ });
367367+368368+ it("if new tree has disabled and old tree does not, add value", async () => {
369369+ const a = await fixture(html`<input type="checkbox" />`);
370370+ const b = await fixture(html`<input type="checkbox" disabled=${true} />`);
371371+372372+ morph(a, b);
373373+374374+ expect(a.outerHTML).to.equal(b.outerHTML);
375375+ expect(a.disabled).to.equal(true);
376376+ });
377377+378378+ it("if new tree has disabled=false and old tree has disabled=true, set value from new tree", async () => {
379379+ const a = await fixture(html`<input type="checkbox" disabled=${false} />`);
380380+ const b = await fixture(html`<input type="checkbox" disabled=${true} />`);
381381+382382+ morph(a, b);
383383+384384+ expect(a.outerHTML).to.equal(b.outerHTML);
385385+ expect(a.disabled).to.equal(true);
386386+ });
387387+388388+ it("if new tree has disabled=true and old tree has disabled=false, set value from new tree", async () => {
389389+ const a = await fixture(html`<input type="checkbox" disabled=${true} />`);
390390+ const b = await fixture(html`<input type="checkbox" disabled=${false} />`);
391391+392392+ morph(a, b);
393393+394394+ expect(a.outerHTML).to.equal(b.outerHTML);
395395+ expect(a.disabled).to.equal(false);
396396+ });
397397+398398+ it("if new tree has no disabled and old tree has disabled mutated to true, set value from new tree", async () => {
399399+ const a = await fixture(html`<input type="checkbox" />`);
400400+ const b = await fixture(html`<input type="checkbox" />`);
401401+ b.disabled = true;
402402+403403+ morph(a, b);
404404+405405+ expect(a.outerHTML).to.equal(b.outerHTML);
406406+ expect(a.disabled).to.equal(true);
407407+ });
408408+409409+ it("if new tree has disabled=false and old tree has disabled mutated to true, set value from new tree", async () => {
410410+ const a = await fixture(html`<input type="checkbox" disabled=${false} />`);
411411+ const b = await fixture(html`<input type="checkbox" />`);
412412+ b.disabled = true;
413413+414414+ morph(a, b);
415415+416416+ expect(a.outerHTML).to.equal(b.outerHTML);
417417+ expect(a.disabled).to.equal(true);
418418+ });
419419+420420+ it("if new tree has disabled=true and old tree has disabled mutated to false, set value from new tree", async () => {
421421+ const a = await fixture(html`<input type="checkbox" disabled=${true} />`);
422422+ const b = await fixture(html`<input type="checkbox" />`);
423423+ b.disabled = false;
424424+425425+ morph(a, b);
426426+427427+ expect(a.outerHTML).to.equal(b.outerHTML);
428428+ expect(a.disabled).to.equal(false);
429429+ });
430430+431431+ it("if new tree has no disabled and old tree has disabled=true, set value from new tree", async () => {
432432+ const a = await fixture(html`<input type="checkbox" />`);
433433+ const b = await fixture(html`<input type="checkbox" disabled=${true} />`);
434434+435435+ morph(a, b);
436436+437437+ expect(a.outerHTML).to.equal(b.outerHTML);
438438+ expect(a.disabled).to.equal(true);
439439+ });
440440+ });
441441+ });
270442});