Skip to content

Commit

Permalink
Add local signals test
Browse files Browse the repository at this point in the history
  • Loading branch information
bencroker committed Feb 14, 2025
1 parent e90319d commit fbea7b1
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions site/routes_tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ func setupTests(ctx context.Context, router chi.Router, signals sessions.Store)
Label: "tests",
Links: []*SidebarLink{
{ID: "key_casing"},
{ID: "local_signals"},
{ID: "merge_fragment"},
{ID: "merge_fragment_signal"},
{ID: "on_load"},
Expand Down
9 changes: 9 additions & 0 deletions site/smoketests/local_signals_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package smoketests

import (
"testing"
)

func TestLocalSignals(t *testing.T) {
setupPageTestOnLoad(t, "tests/local_signals")
}
10 changes: 10 additions & 0 deletions site/static/md/tests/local_signals.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Local Signals

Tests that local signals are assignable in expressions.

<div data-signals-_local="0">
Result:
<code id="result" data-on-load="$_local = 1" data-text="$_local"></code>
<hr />
Expected result on load: <code>1</code>
</div>

0 comments on commit fbea7b1

Please sign in to comment.