-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(frontend): 🧪 write component test for sharebuttons (#340)
- Loading branch information
luctra02
authored and
GitHub
committed
Apr 21, 2024
1 parent
00ce42c
commit 3681e85
Showing
3 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| // Import necessary dependencies | ||
| import { test, expect } from "@playwright/experimental-ct-react"; | ||
| import ShareButtons from "@/components/ShareButtons"; | ||
|
|
||
| // Define the test | ||
| test("Check ShareButtons component", async ({ mount }) => { | ||
| // Mock slug | ||
| const slug = "test-slug"; | ||
|
|
||
| // Mount the ShareButtons component | ||
| const component = await mount(<ShareButtons slug={slug} />); | ||
|
|
||
| // Check if Facebook icon is rendered | ||
| const facebookButton = component.getByLabel("facebook"); | ||
| await expect(facebookButton).toBeVisible(); | ||
|
|
||
| // Check if Linkedin icon is rendered | ||
| const linkedinButton = component.getByLabel("linkedin"); | ||
| await expect(linkedinButton).toBeVisible(); | ||
|
|
||
| // Check if Twitter icon is rendered | ||
| const twitterButton = component.getByLabel("twitter"); | ||
| await expect(twitterButton).toBeVisible(); | ||
| }); |
File renamed without changes.
File renamed without changes.