aboutsummaryrefslogtreecommitdiff
path: root/test/snapshots/simple-lit-example.debug.ts
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-12-10 00:18:59 -0800
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-12-10 00:19:19 -0800
commitab49f95ef25a49f5d8a53bc8242ee490b15a5b74 (patch)
tree8d6dd6fd93a707fb15ec75e57145cf9c61380708 /test/snapshots/simple-lit-example.debug.ts
parent047754d5ddae0b760b807adafcb3678d8702d7df (diff)
downloadbun-ab49f95ef25a49f5d8a53bc8242ee490b15a5b74.tar.gz
bun-ab49f95ef25a49f5d8a53bc8242ee490b15a5b74.tar.zst
bun-ab49f95ef25a49f5d8a53bc8242ee490b15a5b74.zip
:camera:
Diffstat (limited to 'test/snapshots/simple-lit-example.debug.ts')
-rw-r--r--test/snapshots/simple-lit-example.debug.ts73
1 files changed, 73 insertions, 0 deletions
diff --git a/test/snapshots/simple-lit-example.debug.ts b/test/snapshots/simple-lit-example.debug.ts
new file mode 100644
index 000000000..b4ba4f607
--- /dev/null
+++ b/test/snapshots/simple-lit-example.debug.ts
@@ -0,0 +1,73 @@
+import {
+__decorateClass as __decorateClass_4b4920c627822e1f
+} from "http://localhost:8080/bun:wrap";
+import {LitElement, html, css} from "http://localhost:8080/node_modules/lit/index.js";
+import {customElement, property, eventOptions} from "http://localhost:8080/node_modules/lit/decorators.js";
+var loadedResolve;
+var loadedPromise = new Promise((resolve) => {
+ loadedResolve = resolve;
+});
+if (document?.readyState === "loading")
+ document.addEventListener("DOMContentLoaded", () => {
+ loadedResolve();
+ }, { once: true });
+else
+ loadedResolve();
+
+export class MyElement extends LitElement {
+ constructor() {
+ super(...arguments);
+ this.planet = "Earth";
+ }
+ static styles = css`
+ :host {
+ display: inline-block;
+ padding: 10px;
+ background: lightgray;
+ }
+ .planet {
+ color: var(--planet-color, blue);
+ }
+ `;
+ render() {
+ return html`
+ <span @click=${this.togglePlanet} class="planet" id="planet-id"
+ >${this.planet}</span
+ >
+ `;
+ }
+ togglePlanet() {
+ this.planet = this.planet === "Earth" ? "Mars" : "Earth";
+ }
+}
+__decorateClass_4b4920c627822e1f([
+ property()
+], MyElement.prototype, "planet", 2);
+__decorateClass_4b4920c627822e1f([
+ eventOptions({ once: true })
+], MyElement.prototype, "togglePlanet", 1);
+MyElement = __decorateClass_4b4920c627822e1f([
+ customElement("my-element")
+], MyElement);
+function setup() {
+ let element = document.createElement("my-element");
+ element.id = "my-element-id";
+ document.body.appendChild(element);
+}
+export async function test() {
+ setup();
+ await loadedPromise;
+ let element = document.getElementById("my-element-id");
+ let planet = element.shadowRoot.getElementById("planet-id");
+ if (element.__planet !== "Earth")
+ throw new Error("Unexpected planet name: " + element.__planet);
+ planet.click();
+ if (element.__planet !== "Mars")
+ throw new Error("Unexpected planet name: " + element.__planet);
+ planet.click();
+ if (element.__planet !== "Mars")
+ throw new Error("Unexpected planet name: " + element.__planet);
+ return testDone(import.meta.url);
+}
+
+//# sourceMappingURL=http://localhost:8080/simple-lit-example.ts.map