Skip to content

Commit

Permalink
unit test for raw attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
eliknebel committed Aug 15, 2024
1 parent 0a22634 commit 9ebb5c7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/sprocket/reconcilers/recursive_test.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import gleam/option.{None, Some}
import gleeunit/should
import ids/cuid
import sprocket/component.{component, render}
import sprocket/context.{type Context, type Element}
import sprocket/context.{type Context, type Element, Attribute}
import sprocket/hooks.{handler, provider}
import sprocket/html/attributes.{class, classes}
import sprocket/html/elements.{a, div, fragment, raw, text}
Expand Down Expand Up @@ -266,7 +266,7 @@ fn test_component_with_custom_element(ctx: Context, _props) {
ctx,
raw(
"div",
[],
[Attribute("some", dynamic.from("attribute"))],
"An unescaped <b>raw <em>html</em></b> <span style=\"color: blue\">string</span></b>",
),
)
Expand All @@ -283,7 +283,7 @@ pub fn renders_test_component_with_custom_element_test() {
_hooks,
ReconciledCustom(
kind: "raw",
data: "{\"tag\":\"div\",\"attrs\":{},\"innerHtml\":\"An unescaped <b>raw <em>html</em></b> <span style=\\\"color: blue\\\">string</span></b>\"}",
data: "{\"tag\":\"div\",\"attrs\":{\"some\":\"attribute\"},\"innerHtml\":\"An unescaped <b>raw <em>html</em></b> <span style=\\\"color: blue\\\">string</span></b>\"}",
),
) = rendered
}

0 comments on commit 9ebb5c7

Please sign in to comment.