Skip to content

Commit

Permalink
fix: add test for assert property inside of render function
Browse files Browse the repository at this point in the history
  • Loading branch information
smalluban committed Sep 12, 2024
1 parent 9ccd06c commit bd8862e
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/spec/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,29 @@ describe("html:", () => {
});
});

it("sets the property value of the nested element", () => {
define({
tag: "test-html-assert-nested",
value: "",
});

define({
tag: "test-html-assert",
value: "test",
render: ({ value }) => html`
<test-html-assert-nested value="${value}"></test-html-assert-nested>
`,
});

const render = html`<test-html-assert></test-html-assert>`;

render(fragment);

return resolveTimeout(() => {
expect(fragment.children[0].children[0].value).toBe("test");
});
});

describe("attribute expression with combined text value", () => {
const render = (two, three) => html`
<div name="test" class="class-one ${two} ${three}"></div>
Expand Down

0 comments on commit bd8862e

Please sign in to comment.