diff options
author | Jacob Scearcy <jacobscearcy@gmail.com> | 2024-05-06 06:42:35 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-06 14:42:35 +0100 |
commit | 80e2bd66f54bca88a749d40784828d29bae8995f (patch) | |
tree | 587a8b2d24f09e1955f11ab1ae7ca1e16084d4e1 /vitest_snapshots | |
parent | 8adbae91d3e7d526b5950e2299736ab915dc5489 (diff) | |
download | lustre-80e2bd66f54bca88a749d40784828d29bae8995f.tar.gz lustre-80e2bd66f54bca88a749d40784828d29bae8995f.zip |
๐ Use vitest for runtime/vdom testing. (#124)
* ๐งช move tests into test directory, bump birdie to ignore non-gleam files
* implement feedback
* add comments, update doc
Diffstat (limited to 'vitest_snapshots')
-rw-r--r-- | vitest_snapshots/02-interactivity.test.js.snap | 19 | ||||
-rw-r--r-- | vitest_snapshots/vdom.ffi.test.js.snap | 55 |
2 files changed, 74 insertions, 0 deletions
diff --git a/vitest_snapshots/02-interactivity.test.js.snap b/vitest_snapshots/02-interactivity.test.js.snap new file mode 100644 index 0000000..c7c7ce2 --- /dev/null +++ b/vitest_snapshots/02-interactivity.test.js.snap @@ -0,0 +1,19 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`counter example > should render initially 1`] = ` +"<!DOCTYPE html> + +<html lang="en"> + <head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title>๐ง {app_name}</title> + + </head> + + <body> + <div style="width:100vw;height:100vh;padding:1rem;" class="lustre-ui-centre"><div class="lustre-ui-stack"><button class="lustre-ui-button" type="button">+</button><p style="text-align:center;">0</p><button class="lustre-ui-button" type="button">-</button></div></div> + </body> +</html>" +`; diff --git a/vitest_snapshots/vdom.ffi.test.js.snap b/vitest_snapshots/vdom.ffi.test.js.snap new file mode 100644 index 0000000..fa11c73 --- /dev/null +++ b/vitest_snapshots/vdom.ffi.test.js.snap @@ -0,0 +1,55 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`vdom morph > should render smoke test with vdom morph > smoke_test 1`] = ` +"<!DOCTYPE html> + +<html lang="en"> + <head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title>๐ง {app_name}</title> + + </head> + + <body> + <div><p>smoke test</p></div> + </body> +</html>" +`; + +exports[`vdom morph > should render using vdom morph with fragments > fragment_test 1`] = ` +"<!DOCTYPE html> + +<html lang="en"> + <head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title>๐ง {app_name}</title> + + </head> + + <body> + <table><head><tr><th>Person Name</th><th>Person Age</th></tr></head><body><tr><td>Person One</td><td>18</td></tr><tr><td>Person Two</td><td>24</td></tr><tr><td>Person Three</td><td>30</td></tr></body></table> + </body> +</html>" +`; + +exports[`vdom morph > should render using vdom morph with keys > fragment_test 1`] = ` +"<!DOCTYPE html> + +<html lang="en"> + <head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title>๐ง {app_name}</title> + + </head> + + <body> + <ul><tr data-lustre-key="1dfg"><td>Person One</td><td>18</td></tr><tr data-lustre-key="abc3"><td>Person Two</td><td>24</td></tr><tr data-lustre-key="ga4d"><td>Person Three</td><td>30</td></tr></ul> + </body> +</html>" +`; |