Skip to content

Commit

Permalink
update(emoji): finish emoji picker tests
Browse files Browse the repository at this point in the history
  • Loading branch information
luisecm committed Sep 23, 2024
1 parent e35eab1 commit fd2637d
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,4 @@ $RECYCLE.BIN/
/playwright-report/
/blob-report/
/playwright/.cache/
/downloads/
18 changes: 8 additions & 10 deletions playwright/PageObjects/ChatsElements/EmojiPicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,13 @@ export class EmojiPicker extends CombinedSelector {
expect(emojisCount).toEqual(expectedNumber);
}

async validateEmojiSnapshot() {
await expect(this.page).toHaveScreenshot({
maxDiffPixels: 400,
mask: [
this.skinToneSelector,
this.frequentlyUsedSection,
this.page.getByTestId("chat-topbar-profile-picture"),
this.page.getByTestId("chat-preview-picture"),
],
});
async validateSingleEmojiSize(emoji: string, expectedSize: string) {
const emojiLocator = this.page
.getByTestId("emoji-container")
.locator("span")
.filter({
hasText: emoji,
});
await expect(emojiLocator).toHaveCSS("font-size", expectedSize);
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
6 changes: 3 additions & 3 deletions playwright/specs/03-friends-two-instances.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1565,11 +1565,11 @@ test.describe("Two instances tests - Friends and Chats", () => {
// Change emoji size in emojis container view
await chatsMainPageSecond.openEmojiPicker();
await emojiPickerSecond.changeEmojiSizeView("16");
await emojiPickerSecond.validateEmojiSnapshot();
await emojiPickerSecond.validateSingleEmojiSize("😀", "16px");
await emojiPickerSecond.changeEmojiSizeView("45");
await emojiPickerSecond.validateEmojiSnapshot();
await emojiPickerSecond.validateSingleEmojiSize("😀", "45px");
await emojiPickerSecond.changeEmojiSizeView("30");
await emojiPickerSecond.validateEmojiSnapshot();
await emojiPickerSecond.validateSingleEmojiSize("😀", "30px");

// Validate emoji categories displayed in emoji container
const emojiCategories = [
Expand Down

0 comments on commit fd2637d

Please sign in to comment.