Skip to content

Commit

Permalink
Focusing the editor before clicking from the options
Browse files Browse the repository at this point in the history
  • Loading branch information
vivinkrishna-ni committed Oct 3, 2024
1 parent 205e13d commit bac5193
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,10 @@ export class RichTextEditorPageObject {
}

public async clickMentionListboxOption(index: number): Promise<void> {
if (this.isMentionListboxOpened()) {
this.richTextEditorElement.tiptapEditor.commands.focus();
await waitForUpdatesAsync();
}
const listOption = this.getAllListItemsInMentionBox()[index];
listOption?.click();
await waitForUpdatesAsync();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1566,9 +1566,10 @@ describe('RichTextEditorMentionListbox', () => {
'username1',
'username2'
]);
// expect(pageObject.isMentionListboxOpened()).toBeTrue();
expect(pageObject.isMentionListboxOpened()).toBeTrue();

await pageObject.clickMentionListboxOption(0);
// await pageObject.clickMentionListboxOption(0);
await pageObject.sliceEditorContent(0, 2);

await appendTestMentionConfiguration(element, [
{ key: 'test:1', displayName: 'testname1' },
Expand All @@ -1581,7 +1582,7 @@ describe('RichTextEditorMentionListbox', () => {
'testname1',
'testname2'
]);
// expect(pageObject.isMentionListboxOpened()).toBeTrue();
expect(pageObject.isMentionListboxOpened()).toBeTrue();
}
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,9 @@ Plain text 3`);
await appendUserMentionConfiguration(element, [
{ key: 'user:1', displayName: 'username1' }
]);

await commitFirstMentionBoxOptionIntoEditor('@');

expect(element.getMarkdown()).toEqual('<user:1> ');
});
}
Expand Down

0 comments on commit bac5193

Please sign in to comment.