aboutsummaryrefslogtreecommitdiff
path: root/test/bun.js/solid-dom-fixtures/conditionalExpressions/code.js
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-06-22 23:21:48 -0700
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-06-22 23:21:48 -0700
commit729d445b6885f69dd2c6355f38707bd42851c791 (patch)
treef87a7c408929ea3f57bbb7ace380cf869da83c0e /test/bun.js/solid-dom-fixtures/conditionalExpressions/code.js
parent25f820c6bf1d8ec6d444ef579cc036b8c0607b75 (diff)
downloadbun-jarred/rename.tar.gz
bun-jarred/rename.tar.zst
bun-jarred/rename.zip
change the directory structurejarred/rename
Diffstat (limited to 'test/bun.js/solid-dom-fixtures/conditionalExpressions/code.js')
-rw-r--r--test/bun.js/solid-dom-fixtures/conditionalExpressions/code.js71
1 files changed, 71 insertions, 0 deletions
diff --git a/test/bun.js/solid-dom-fixtures/conditionalExpressions/code.js b/test/bun.js/solid-dom-fixtures/conditionalExpressions/code.js
new file mode 100644
index 000000000..80f1a6a4f
--- /dev/null
+++ b/test/bun.js/solid-dom-fixtures/conditionalExpressions/code.js
@@ -0,0 +1,71 @@
+const template1 = <div>{simple}</div>;
+
+const template2 = <div>{state.dynamic}</div>;
+
+const template3 = <div>{simple ? good : bad}</div>;
+
+const template4 = <div>{simple ? good() : bad}</div>;
+
+const template5 = <div>{state.dynamic ? good() : bad}</div>;
+
+const template6 = <div>{state.dynamic && good()}</div>;
+
+const template7 = (
+ <div>{state.count > 5 ? (state.dynamic ? best : good()) : bad}</div>
+);
+
+const template8 = <div>{state.dynamic && state.something && good()}</div>;
+
+const template9 = <div>{(state.dynamic && good()) || bad}</div>;
+
+const template10 = (
+ <div>{state.a ? "a" : state.b ? "b" : state.c ? "c" : "fallback"}</div>
+);
+
+const template11 = (
+ <div>{state.a ? a() : state.b ? b() : state.c ? "c" : "fallback"}</div>
+);
+
+const template12 = <Comp render={state.dynamic ? good() : bad} />;
+
+// no dynamic predicate
+const template13 = <Comp render={state.dynamic ? good : bad} />;
+
+const template14 = <Comp render={state.dynamic && good()} />;
+
+// no dynamic predicate
+const template15 = <Comp render={state.dynamic && good} />;
+
+const template16 = <Comp render={state.dynamic || good()} />;
+
+const template17 = <Comp render={state.dynamic ? <Comp /> : <Comp />} />;
+
+const template18 = <Comp>{state.dynamic ? <Comp /> : <Comp />}</Comp>;
+
+const template19 = <div innerHTML={state.dynamic ? <Comp /> : <Comp />} />;
+
+const template20 = <div>{state.dynamic ? <Comp /> : <Comp />}</div>;
+
+const template21 = <Comp render={state?.dynamic ? "a" : "b"} />;
+
+const template22 = <Comp>{state?.dynamic ? "a" : "b"}</Comp>;
+
+const template23 = <div innerHTML={state?.dynamic ? "a" : "b"} />;
+
+const template24 = <div>{state?.dynamic ? "a" : "b"}</div>;
+
+const template25 = <Comp render={state.dynamic ?? <Comp />} />;
+
+const template26 = <Comp>{state.dynamic ?? <Comp />}</Comp>;
+
+const template27 = <div innerHTML={state.dynamic ?? <Comp />} />;
+
+const template28 = <div>{state.dynamic ?? <Comp />}</div>;
+
+const template29 = <div>{(thing() && thing1()) ?? thing2() ?? thing3()}</div>;
+
+const template30 = <div>{thing() || thing1() || thing2()}</div>;
+
+const template31 = (
+ <Comp value={count() ? (count() ? count() : count()) : count()} />
+);