-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
clean URL for community share button
fixes #889
- Loading branch information
1 parent
36c6c75
commit 336b77a
Showing
2 changed files
with
33 additions
and
7 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
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,32 @@ | ||
import { test, expect } from "@playwright/test"; | ||
import { pauseIfVideoRecording } from "../../testUtils.js"; | ||
|
||
test.describe("share links", () => { | ||
test.use({ | ||
contextOptions: { | ||
permissions: ["clipboard-read", "clipboard-write"], | ||
}, | ||
}); | ||
|
||
test("community share button should create a clean URL", async ({ page }) => { | ||
await page.goto( | ||
"/devhub.near/widget/app?page=community&handle=webassemblymusic" | ||
); | ||
const shareButton = await page.locator("button", { hasText: "Share" }); | ||
await expect(shareButton).toBeVisible(); | ||
await shareButton.click(); | ||
|
||
const linkUrlFromClipboard = await page.evaluate( | ||
"navigator.clipboard.readText()" | ||
); | ||
expect(linkUrlFromClipboard).toEqual( | ||
"https://devhub.near.page/community/webassemblymusic" | ||
); | ||
await pauseIfVideoRecording(page); | ||
await page.goto(linkUrlFromClipboard); | ||
|
||
await expect(await page.getByText("WebAssembly Music")).toBeVisible({ | ||
timeout: 10000, | ||
}); | ||
}); | ||
}); |