You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/lexical-playground/__tests__/regression/2648-triple-click.spec.mjs
+12-17Lines changed: 12 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,10 @@
8
8
9
9
import{
10
10
assertHTML,
11
-
assertSelection,
12
11
click,
12
+
expect,
13
13
focusEditor,
14
+
getEditorElement,
14
15
html,
15
16
initialize,
16
17
test,
@@ -129,23 +130,13 @@ test.describe.parallel('Regression test #2648', () => {
129
130
</p>
130
131
`;
131
132
132
-
constfirstLineSelection={
133
-
anchorOffset: 0,
134
-
anchorPath: [0,0,0],
135
-
focusOffset: 12,
136
-
focusPath: [0,0,0],
137
-
};
138
-
139
-
constsecondLineSelection={
140
-
anchorOffset: 0,
141
-
anchorPath: [1,0,0],
142
-
focusOffset: 12,
143
-
focusPath: [1,0,0],
144
-
};
145
-
146
133
//format and check the first line
147
134
awaitclick(page,firstLine,{clickCount: 4});// Note: the issue sometimes shows up on triple click but the 4th click seems to be a more reliable way to replicate it
148
-
awaitassertSelection(page,firstLineSelection);
135
+
expect(
136
+
awaitgetEditorElement(page).evaluate(()=>
137
+
window.getSelection()?.toString(),
138
+
),
139
+
).toBe('line of text');
149
140
awaitclick(page,dropDownSelector);
150
141
awaitclick(page,formatSelector);
151
142
awaitassertHTML(
@@ -159,7 +150,11 @@ test.describe.parallel('Regression test #2648', () => {
0 commit comments