Skip to content

Commit

Permalink
Add theme class to HR test references
Browse files Browse the repository at this point in the history
  • Loading branch information
daltnd committed May 12, 2024
1 parent 0947e73 commit 5800ecb
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,14 @@ test.describe('HTML CopyAndPaste', () => {
await assertHTML(
page,
html`
<hr class="" contenteditable="false" data-lexical-decorator="true" />
<hr class="" contenteditable="false" data-lexical-decorator="true" />
<hr
class="PlaygroundEditorTheme__hr"
contenteditable="false"
data-lexical-decorator="true" />
<hr
class="PlaygroundEditorTheme__hr"
contenteditable="false"
data-lexical-decorator="true" />
<div
class="PlaygroundEditorTheme__blockCursor"
contenteditable="false"
Expand All @@ -228,13 +234,19 @@ test.describe('HTML CopyAndPaste', () => {
await assertHTML(
page,
html`
<hr class="" contenteditable="false" data-lexical-decorator="true" />
<hr
class="PlaygroundEditorTheme__hr"
contenteditable="false"
data-lexical-decorator="true" />
<p
class="PlaygroundEditorTheme__paragraph PlaygroundEditorTheme__ltr"
dir="ltr">
<span data-lexical-text="true">Text between HRs</span>
</p>
<hr class="" contenteditable="false" data-lexical-decorator="true" />
<hr
class="PlaygroundEditorTheme__hr"
contenteditable="false"
data-lexical-decorator="true" />
`,
);
await assertSelection(page, {
Expand Down Expand Up @@ -266,7 +278,10 @@ test.describe('HTML CopyAndPaste', () => {
dir="ltr">
<span data-lexical-text="true">Hello</span>
</p>
<hr class="" contenteditable="false" data-lexical-decorator="true" />
<hr
class="PlaygroundEditorTheme__hr"
contenteditable="false"
data-lexical-decorator="true" />
<p
class="PlaygroundEditorTheme__paragraph PlaygroundEditorTheme__ltr"
dir="ltr">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,10 @@ test.describe('HTML Lists CopyAndPaste', () => {
<span data-lexical-text="true">one</span>
</li>
</ul>
<hr class="" contenteditable="false" data-lexical-decorator="true" />
<hr
class="PlaygroundEditorTheme__hr"
contenteditable="false"
data-lexical-decorator="true" />
<ul class="PlaygroundEditorTheme__ul">
<li
class="PlaygroundEditorTheme__listItem PlaygroundEditorTheme__ltr"
Expand Down
51 changes: 39 additions & 12 deletions packages/lexical-playground/__tests__/e2e/HorizontalRule.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ test.describe('HorizontalRule', () => {
page,
html`
<p class="PlaygroundEditorTheme__paragraph"><br /></p>
<hr class="" contenteditable="false" data-lexical-decorator="true" />
<hr
class="PlaygroundEditorTheme__hr"
contenteditable="false"
data-lexical-decorator="true" />
<p class="PlaygroundEditorTheme__paragraph"><br /></p>
`,
);
Expand Down Expand Up @@ -107,7 +110,10 @@ test.describe('HorizontalRule', () => {
dir="ltr">
<span data-lexical-text="true">Some text</span>
</p>
<hr class="" contenteditable="false" data-lexical-decorator="true" />
<hr
class="PlaygroundEditorTheme__hr"
contenteditable="false"
data-lexical-decorator="true" />
<p
class="PlaygroundEditorTheme__paragraph PlaygroundEditorTheme__ltr"
dir="ltr">
Expand Down Expand Up @@ -135,7 +141,7 @@ test.describe('HorizontalRule', () => {
if (!isCollab) {
await assertHTML(
page,
'<div class="PlaygroundEditorTheme__blockCursor" contenteditable="false" data-lexical-cursor="true"></div><hr class="" data-lexical-decorator="true" contenteditable="false"><p class="PlaygroundEditorTheme__paragraph PlaygroundEditorTheme__ltr" dir="ltr"><span data-lexical-text="true">Some more text</span></p>',
'<div class="PlaygroundEditorTheme__blockCursor" contenteditable="false" data-lexical-cursor="true"></div><hr class="PlaygroundEditorTheme__hr" data-lexical-decorator="true" contenteditable="false"><p class="PlaygroundEditorTheme__paragraph PlaygroundEditorTheme__ltr" dir="ltr"><span data-lexical-text="true">Some more text</span></p>',
);
}

Expand Down Expand Up @@ -187,7 +193,10 @@ test.describe('HorizontalRule', () => {
dir="ltr">
<span data-lexical-text="true">Test</span>
</p>
<hr class="" contenteditable="false" data-lexical-decorator="true" />
<hr
class="PlaygroundEditorTheme__hr"
contenteditable="false"
data-lexical-decorator="true" />
<p class="PlaygroundEditorTheme__paragraph"><br /></p>
`,
);
Expand Down Expand Up @@ -248,7 +257,10 @@ test.describe('HorizontalRule', () => {
dir="ltr">
<span data-lexical-text="true">Te</span>
</p>
<hr class="" contenteditable="false" data-lexical-decorator="true" />
<hr
class="PlaygroundEditorTheme__hr"
contenteditable="false"
data-lexical-decorator="true" />
<p
class="PlaygroundEditorTheme__paragraph PlaygroundEditorTheme__ltr"
dir="ltr">
Expand Down Expand Up @@ -278,7 +290,10 @@ test.describe('HorizontalRule', () => {
page,
html`
<p class="PlaygroundEditorTheme__paragraph"><br /></p>
<hr class="" contenteditable="false" data-lexical-decorator="true" />
<hr
class="PlaygroundEditorTheme__hr"
contenteditable="false"
data-lexical-decorator="true" />
<p class="PlaygroundEditorTheme__paragraph"><br /></p>
`,
);
Expand All @@ -305,7 +320,10 @@ test.describe('HorizontalRule', () => {
page,
html`
<p class="PlaygroundEditorTheme__paragraph"><br /></p>
<hr class="" contenteditable="false" data-lexical-decorator="true" />
<hr
class="PlaygroundEditorTheme__hr"
contenteditable="false"
data-lexical-decorator="true" />
<p class="PlaygroundEditorTheme__paragraph"><br /></p>
`,
);
Expand All @@ -326,9 +344,15 @@ test.describe('HorizontalRule', () => {
page,
html`
<p class="PlaygroundEditorTheme__paragraph"><br /></p>
<hr class="" contenteditable="false" data-lexical-decorator="true" />
<hr
class="PlaygroundEditorTheme__hr"
contenteditable="false"
data-lexical-decorator="true" />
<p class="PlaygroundEditorTheme__paragraph"><br /></p>
<hr class="" contenteditable="false" data-lexical-decorator="true" />
<hr
class="PlaygroundEditorTheme__hr"
contenteditable="false"
data-lexical-decorator="true" />
<p class="PlaygroundEditorTheme__paragraph"><br /></p>
`,
);
Expand Down Expand Up @@ -359,7 +383,10 @@ test.describe('HorizontalRule', () => {
page,
html`
<p class="PlaygroundEditorTheme__paragraph"><br /></p>
<hr class="" contenteditable="false" data-lexical-decorator="true" />
<hr
class="PlaygroundEditorTheme__hr"
contenteditable="false"
data-lexical-decorator="true" />
<p class="PlaygroundEditorTheme__paragraph"><br /></p>
`,
);
Expand All @@ -380,7 +407,7 @@ test.describe('HorizontalRule', () => {
html`
<p class="PlaygroundEditorTheme__paragraph"><br /></p>
<hr
class="selected"
class="PlaygroundEditorTheme__hr selected"
contenteditable="false"
data-lexical-decorator="true" />
`,
Expand Down Expand Up @@ -409,7 +436,7 @@ test.describe('HorizontalRule', () => {
page,
html`
<hr
class="selected"
class="PlaygroundEditorTheme__hr selected"
contenteditable="false"
data-lexical-decorator="true" />
`,
Expand Down
24 changes: 18 additions & 6 deletions packages/lexical-playground/__tests__/e2e/Markdown.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ test.describe('Markdown', () => {
},
{
expectation:
'<hr class="" data-lexical-decorator="true" contenteditable="false" /><p class="PlaygroundEditorTheme__paragraph"><br></p>',
'<hr class="PlaygroundEditorTheme__hr" data-lexical-decorator="true" contenteditable="false" /><p class="PlaygroundEditorTheme__paragraph"><br></p>',
importExpectation: '',
isBlockTest: true,
markdownImport: '',
Expand All @@ -159,7 +159,7 @@ test.describe('Markdown', () => {
},
{
expectation:
'<hr class="" data-lexical-decorator="true" contenteditable="false" /><p class="PlaygroundEditorTheme__paragraph"><br></p>',
'<hr class="PlaygroundEditorTheme__hr" data-lexical-decorator="true" contenteditable="false" /><p class="PlaygroundEditorTheme__paragraph"><br></p>',
importExpectation: '',
isBlockTest: true,
markdownImport: '',
Expand Down Expand Up @@ -493,14 +493,20 @@ test.describe('Markdown', () => {
},
{
html: html`
<hr class="" contenteditable="false" data-lexical-decorator="true" />
<hr
class="PlaygroundEditorTheme__hr"
contenteditable="false"
data-lexical-decorator="true" />
<p><br /></p>
`,
text: '--- ',
},
{
html: html`
<hr class="" contenteditable="false" data-lexical-decorator="true" />
<hr
class="PlaygroundEditorTheme__hr"
contenteditable="false"
data-lexical-decorator="true" />
<p><br /></p>
`,
text: '*** ',
Expand Down Expand Up @@ -1171,7 +1177,10 @@ const TYPED_MARKDOWN_HTML = html`
dir="ltr">
<span data-lexical-text="true">Quote</span>
</blockquote>
<hr class="" contenteditable="false" data-lexical-decorator="true" />
<hr
class="PlaygroundEditorTheme__hr"
contenteditable="false"
data-lexical-decorator="true" />
<ul class="PlaygroundEditorTheme__ul">
<li
value="1"
Expand Down Expand Up @@ -1385,7 +1394,10 @@ const IMPORTED_MARKDOWN_HTML = html`
<h3 class="PlaygroundEditorTheme__h3 PlaygroundEditorTheme__ltr" dir="ltr">
<span data-lexical-text="true">Horizontal Rules</span>
</h3>
<hr class="" contenteditable="false" data-lexical-decorator="true" />
<hr
class="PlaygroundEditorTheme__hr"
contenteditable="false"
data-lexical-decorator="true" />
<h3 class="PlaygroundEditorTheme__h3 PlaygroundEditorTheme__ltr" dir="ltr">
<span data-lexical-text="true">Blockquotes</span>
</h3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ test.describe('Selection', () => {
<span data-lexical-text="true">Some text</span>
</h1>
<hr
class="selected"
class="PlaygroundEditorTheme__hr selected"
contenteditable="false"
data-lexical-decorator="true" />
<h1
Expand Down

0 comments on commit 5800ecb

Please sign in to comment.