mol_jsx_lib 0.0.58 → 0.0.59

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.
package/web.test.js CHANGED
@@ -326,7 +326,7 @@ var $;
326
326
  return $mol_jsx("button", { title: props.hint }, target());
327
327
  };
328
328
  const dom = $mol_jsx(Button, { id: "foo", hint: "click me" }, () => 'hey!');
329
- $mol_assert_equal(dom.outerHTML, '<button title="click me" id="foo">hey!</button>');
329
+ $mol_assert_equal(dom.outerHTML, '<button title="click me" id="foo" class="Button">hey!</button>');
330
330
  },
331
331
  'Nested guid generation'() {
332
332
  const Foo = () => {
@@ -338,7 +338,7 @@ var $;
338
338
  return $mol_jsx("span", null, icon);
339
339
  };
340
340
  const dom = $mol_jsx(Foo, { id: "foo" });
341
- $mol_assert_equal(dom.outerHTML, '<div id="foo"><span id="foo/bar"><img id="foo/icon"></span></div>');
341
+ $mol_assert_equal(dom.outerHTML, '<div id="foo" class="Foo"><span id="foo/bar" class="Foo_bar Bar"><img id="foo/icon" class="Foo_icon"></span></div>');
342
342
  },
343
343
  'Fail on non unique ids'() {
344
344
  const App = () => {
@@ -351,13 +351,13 @@ var $;
351
351
  'Owner based guid generationn'() {
352
352
  const Foo = () => {
353
353
  return $mol_jsx("div", null,
354
- $mol_jsx(Bar, { id: "bar", icon: () => $mol_jsx("img", { id: "icon" }) }));
354
+ $mol_jsx(Bar, { id: "middle", icon: () => $mol_jsx("img", { id: "icon" }) }));
355
355
  };
356
356
  const Bar = (props) => {
357
357
  return $mol_jsx("span", null, props.icon());
358
358
  };
359
- const dom = $mol_jsx(Foo, { id: "foo" });
360
- $mol_assert_equal(dom.outerHTML, '<div id="foo"><span id="foo/bar"><img id="foo/icon"></span></div>');
359
+ const dom = $mol_jsx(Foo, { id: "app" });
360
+ $mol_assert_equal(dom.outerHTML, '<div id="app" class="Foo"><span id="app/middle" class="Foo_middle Bar"><img id="app/icon" class="Foo_icon"></span></div>');
361
361
  },
362
362
  'Fail on same ids from different caller'() {
363
363
  const Foo = () => {
@@ -1451,7 +1451,7 @@ var $;
1451
1451
  const dom = $mol_jsx(Foo, { id: "foo", title: "bar" },
1452
1452
  "xxx",
1453
1453
  123);
1454
- $mol_assert_equal(dom.outerHTML, '<div id="foo">bar xxx-123</div>');
1454
+ $mol_assert_equal(dom.outerHTML, '<div id="foo" class="Foo">bar xxx-123</div>');
1455
1455
  },
1456
1456
  'View by element'() {
1457
1457
  let br;
@@ -1485,10 +1485,10 @@ var $;
1485
1485
  const dom = $mol_jsx_attach(doc, () => $mol_jsx(Title, { id: "foo" }));
1486
1486
  const title = Title.of(dom);
1487
1487
  $mol_assert_equal(title.ownerDocument, doc);
1488
- $mol_assert_equal(doc.documentElement.outerHTML, '<html><body id="foo">foo</body></html>');
1488
+ $mol_assert_equal(doc.documentElement.outerHTML, '<html><body id="foo" class="Title">foo</body></html>');
1489
1489
  title.value('bar');
1490
1490
  await $mol_wire_fiber.sync();
1491
- $mol_assert_equal(doc.documentElement.outerHTML, '<html><body id="foo">bar</body></html>');
1491
+ $mol_assert_equal(doc.documentElement.outerHTML, '<html><body id="foo" class="Title">bar</body></html>');
1492
1492
  },
1493
1493
  async 'Nested bound views'($) {
1494
1494
  class Task extends $mol_jsx_view {
@@ -1516,15 +1516,15 @@ var $;
1516
1516
  ], App.prototype, "title", null);
1517
1517
  const doc = $mol_dom_parse('<html xmlns="http://www.w3.org/1999/xhtml"><body id="root"></body></html>');
1518
1518
  const root = $.$mol_jsx_attach(doc, () => $mol_jsx(App, { "$": $, id: "root" }));
1519
- $mol_assert_equal($mol_dom_serialize(doc.documentElement), '<html xmlns="http://www.w3.org/1999/xhtml"><body id="root" class="list"></body></html>');
1519
+ $mol_assert_equal($mol_dom_serialize(doc.documentElement), '<html xmlns="http://www.w3.org/1999/xhtml"><body id="root" class="list App List"></body></html>');
1520
1520
  App.of(root).title('barbar');
1521
1521
  await $mol_wire_fiber.sync();
1522
1522
  $mol_assert_equal(Task.of(root.firstElementChild).title(), 'barbar');
1523
- $mol_assert_equal(doc.documentElement.outerHTML, '<html xmlns="http://www.w3.org/1999/xhtml"><body id="root" class="list"><h1 id="root/task">barbar</h1></body></html>');
1523
+ $mol_assert_equal(doc.documentElement.outerHTML, '<html xmlns="http://www.w3.org/1999/xhtml"><body id="root" class="list App List"><h1 id="root/task" class="App_task Task">barbar</h1></body></html>');
1524
1524
  Task.of(root.firstElementChild).title('foofoo');
1525
1525
  await $mol_wire_fiber.sync();
1526
1526
  $mol_assert_equal(App.of(root).title(), 'foofoo');
1527
- $mol_assert_equal(doc.documentElement.outerHTML, '<html xmlns="http://www.w3.org/1999/xhtml"><body id="root" class="list"><h1 id="root/task">foofoo</h1></body></html>');
1527
+ $mol_assert_equal(doc.documentElement.outerHTML, '<html xmlns="http://www.w3.org/1999/xhtml"><body id="root" class="list App List"><h1 id="root/task" class="App_task Task">foofoo</h1></body></html>');
1528
1528
  },
1529
1529
  });
1530
1530
  })($ || ($ = {}));