Skip to content

Commit

Permalink
Merge pull request #6 from nolanlawson/shadowrootmode
Browse files Browse the repository at this point in the history
  • Loading branch information
jwloka authored Aug 10, 2024
2 parents 364b2ad + 213c713 commit d7d0b1e
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"cSpell.words": ["shadowroot"]
"cSpell.words": ["shadowrootmode"]
}
2 changes: 1 addition & 1 deletion src/renderElement.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ describe("renderElement()", () => {

expect(actual).toMatchInlineSnapshot(`
"<div>
<template shadowroot="open">
<template shadowrootmode="open">
<p>
inside
</p>
Expand Down
4 changes: 2 additions & 2 deletions src/renderShadowContent.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe("renderShadowContent", () => {
const actual = renderShadowContent(target, { indent: "" });

expect(actual).toMatchInlineSnapshot(`
" <template shadowroot="open">
" <template shadowrootmode="open">
EXPECTED
</template>"
`);
Expand All @@ -25,7 +25,7 @@ EXPECTED
const actual = renderShadowContent(target, { indent: "", shadowRoots: "declarative" });

expect(actual).toMatchInlineSnapshot(`
" <template shadowroot="open">
" <template shadowrootmode="open">
EXPECTED
</template>"
`);
Expand Down
2 changes: 1 addition & 1 deletion src/renderShadowContent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ export const renderShadowContent = (
if (shadowRoots === "devtools") {
return `${indent + INDENTATION}#shadowRoot\n${element}`;
}
return `${indent + INDENTATION}<template shadowroot="open">\n${element}\n${indent + INDENTATION}</template>`;
return `${indent + INDENTATION}<template shadowrootmode="open">\n${element}\n${indent + INDENTATION}</template>`;
};
44 changes: 22 additions & 22 deletions src/renderToString.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe("renderToString()", () => {

expect(actual).toMatchInlineSnapshot(`
"<div>
<template shadowroot="open">
<template shadowrootmode="open">
<p>
inside
</p>
Expand All @@ -45,7 +45,7 @@ describe("renderToString()", () => {

expect(actual).toMatchInlineSnapshot(`
"<div>
<template shadowroot="open">
<template shadowrootmode="open">
<input
aria-required="true"
id="name"
Expand All @@ -68,7 +68,7 @@ describe("renderToString()", () => {

expect(actual).toMatchInlineSnapshot(`
"<div>
<template shadowroot="open">
<template shadowrootmode="open">
<br />
</template>
</div>"
Expand All @@ -94,7 +94,7 @@ describe("renderToString()", () => {

expect(actual).toMatchInlineSnapshot(`
"<div>
<template shadowroot="open">
<template shadowrootmode="open">
<a
class="link link--display-inline-block link--bg"
href="expectedUrl"
Expand All @@ -119,12 +119,12 @@ describe("renderToString()", () => {

expect(actual).toMatchInlineSnapshot(`
"<div>
<template shadowroot="open">
<template shadowrootmode="open">
<p>
inside
</p>
<div>
<template shadowroot="open">
<template shadowrootmode="open">
<button>
click me I'm inside of a second root
</button>
Expand All @@ -142,7 +142,7 @@ describe("renderToString()", () => {

expect(actual).toMatchInlineSnapshot(`
"<div>
<template shadowroot="open">
<template shadowrootmode="open">
<p>
inside
</p>
Expand Down Expand Up @@ -192,7 +192,7 @@ describe("renderToString()", () => {

expect(actual).toMatchInlineSnapshot(`
"<div>
<template shadowroot="open">
<template shadowrootmode="open">
<p>
inside
</p>
Expand Down Expand Up @@ -353,7 +353,7 @@ describe("render w/ slottedContent map-contents", () => {

expect(actual).toMatchInlineSnapshot(`
"<host-element>
<template shadowroot="open">
<template shadowrootmode="open">
<slot>
<p>
EXPECTED
Expand All @@ -377,7 +377,7 @@ describe("render w/ slottedContent map-contents", () => {

expect(actual).toMatchInlineSnapshot(`
"<host-element>
<template shadowroot="open">
<template shadowrootmode="open">
<slot name="target">
#contents
<p slot="target">
Expand All @@ -399,7 +399,7 @@ describe("render w/ slottedContent map-contents", () => {

expect(actual).toMatchInlineSnapshot(`
"<host-element>
<template shadowroot="open">
<template shadowrootmode="open">
<slot>
#contents
<p>
Expand All @@ -424,7 +424,7 @@ describe("render w/ slottedContent map-contents", () => {

expect(actual).toMatchInlineSnapshot(`
"<host-element>
<template shadowroot="open">
<template shadowrootmode="open">
<slot>
#contents
<div>
Expand Down Expand Up @@ -452,7 +452,7 @@ describe("render w/ slottedContent map-contents", () => {

expect(actual).toMatchInlineSnapshot(`
"<host-element>
<template shadowroot="open">
<template shadowrootmode="open">
<slot>
#contents
<slot></slot>
Expand All @@ -474,9 +474,9 @@ describe("render w/ slottedContent map-contents", () => {

expect(actual).toMatchInlineSnapshot(`
"<my-target>
<template shadowroot="open">
<template shadowrootmode="open">
<host-element>
<template shadowroot="open">
<template shadowrootmode="open">
<slot>
#contents
<div>
Expand Down Expand Up @@ -507,7 +507,7 @@ describe("render w/ slottedContent reveal-contents", () => {

expect(actual).toMatchInlineSnapshot(`
"<host-element>
<template shadowroot="open">
<template shadowrootmode="open">
<slot>
<p>
EXPECTED
Expand All @@ -531,7 +531,7 @@ describe("render w/ slottedContent reveal-contents", () => {

expect(actual).toMatchInlineSnapshot(`
"<host-element>
<template shadowroot="open">
<template shadowrootmode="open">
<slot name="target">
#contents
<p slot="target">
Expand All @@ -556,7 +556,7 @@ describe("render w/ slottedContent reveal-contents", () => {

expect(actual).toMatchInlineSnapshot(`
"<host-element>
<template shadowroot="open">
<template shadowrootmode="open">
<slot>
#contents
<p>
Expand Down Expand Up @@ -584,7 +584,7 @@ describe("render w/ slottedContent reveal-contents", () => {

expect(actual).toMatchInlineSnapshot(`
"<host-element>
<template shadowroot="open">
<template shadowrootmode="open">
<slot>
#contents
<div>
Expand Down Expand Up @@ -621,7 +621,7 @@ describe("render w/ slottedContent reveal-contents", () => {

expect(actual).toMatchInlineSnapshot(`
"<host-element>
<template shadowroot="open">
<template shadowrootmode="open">
<slot>
#contents
<slot></slot>
Expand All @@ -644,9 +644,9 @@ describe("render w/ slottedContent reveal-contents", () => {

expect(actual).toMatchInlineSnapshot(`
"<my-target>
<template shadowroot="open">
<template shadowrootmode="open">
<host-element>
<template shadowroot="open">
<template shadowrootmode="open">
<slot>
#contents
<div>
Expand Down

0 comments on commit d7d0b1e

Please sign in to comment.