Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Virtuoso } from 'react-virtuoso';

import EmojiCategoryRow from './EmojiCategoryRow';
import type { EmojiByCategory } from '../../../../app/emoji/client';
import { CustomScrollbars } from '../../../components/CustomScrollbars';
import { VirtualizedScrollbars } from '../../../components/CustomScrollbars';

type CategoriesResultProps = {
emojiListByCategory: EmojiByCategory[];
Expand All @@ -33,7 +33,7 @@ const CategoriesResult = forwardRef<VirtuosoHandle, CategoriesResultProps>(funct
`}
height='full'
>
<CustomScrollbars>
<VirtualizedScrollbars>
<Virtuoso
ref={ref}
totalCount={emojiListByCategory.length}
Expand All @@ -60,7 +60,7 @@ const CategoriesResult = forwardRef<VirtuosoHandle, CategoriesResultProps>(funct
/>
)}
/>
</CustomScrollbars>
</VirtualizedScrollbars>
</Box>
);
});
Expand Down
28 changes: 17 additions & 11 deletions apps/meteor/tests/e2e/emojis.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,28 @@ test.describe.serial('emoji', () => {
await page.goto('/home');
});

test('should focus the active emoji tab category', async () => {
const activityEmojiTab = poHomeChannel.content.getEmojiPickerTabByName('Activity');

test('should display emoji picker properly', async ({ page }) => {
await poHomeChannel.sidenav.openChat(targetChannel);
await poHomeChannel.content.btnComposerEmoji.click();
await activityEmojiTab.click();

await expect(activityEmojiTab).toBeFocused();
});
await test.step('should display scroller', async () => {
await expect(poHomeChannel.content.scrollerEmojiPicker).toBeVisible();
});

test('expect pick and send grinning emoji', async ({ page }) => {
await poHomeChannel.sidenav.openChat(targetChannel);
await poHomeChannel.content.pickEmoji('grinning');
await page.keyboard.press('Enter');
await test.step('should focus the active emoji tab category', async () => {
const activityEmojiTab = poHomeChannel.content.getEmojiPickerTabByName('Activity');
await activityEmojiTab.click();

await expect(activityEmojiTab).toBeFocused();
});

await test.step('should pick and send grinning emoji', async () => {
await poHomeChannel.sidenav.openChat(targetChannel);
await poHomeChannel.content.pickEmoji('grinning');
await page.keyboard.press('Enter');

await expect(poHomeChannel.content.lastUserMessage).toContainText('😀');
await expect(poHomeChannel.content.lastUserMessage).toContainText('😀');
});
});

test('expect send emoji via text', async ({ page }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,10 @@ export class HomeContent {
return this.page.getByRole('dialog', { name: 'Emoji picker' });
}

get scrollerEmojiPicker(): Locator {
return this.dialogEmojiPicker.locator('[data-overlayscrollbars]');
}

getEmojiPickerTabByName(name: string) {
return this.dialogEmojiPicker.locator(`role=tablist >> role=tab[name="${name}"]`);
}
Expand Down
Loading