+
diff --git a/instances/infrastructure-committee.near/widget/components/proposals/Proposal.jsx b/instances/infrastructure-committee.near/widget/components/proposals/Proposal.jsx
index 5aefc8d7d..7b4c9b1d9 100644
--- a/instances/infrastructure-committee.near/widget/components/proposals/Proposal.jsx
+++ b/instances/infrastructure-committee.near/widget/components/proposals/Proposal.jsx
@@ -848,11 +848,6 @@ return (
src={`${REPL_DEVHUB}/widget/devhub.components.molecule.SimpleMDEViewer`}
props={{
content: snapshot.description,
- embeddCSS: `
- body {
- font-size: 14px !important;
- }
- `,
}}
/>
diff --git a/instances/infrastructure-committee.near/widget/components/rfps/Rfp.jsx b/instances/infrastructure-committee.near/widget/components/rfps/Rfp.jsx
index 5392169d6..47268022b 100644
--- a/instances/infrastructure-committee.near/widget/components/rfps/Rfp.jsx
+++ b/instances/infrastructure-committee.near/widget/components/rfps/Rfp.jsx
@@ -671,11 +671,6 @@ return (
src={`${REPL_DEVHUB}/widget/devhub.components.molecule.SimpleMDEViewer`}
props={{
content: snapshot.description,
- embeddCSS: `
- body {
- font-size: 14px;
- }
- `,
}}
/>
diff --git a/playwright-tests/tests/events/proposals.spec.js b/playwright-tests/tests/events/proposals.spec.js
index 5545397a5..15859e748 100644
--- a/playwright-tests/tests/events/proposals.spec.js
+++ b/playwright-tests/tests/events/proposals.spec.js
@@ -481,7 +481,6 @@ test.describe("Wallet is connected", () => {
const delay_milliseconds_between_keypress_when_typing = 0;
const commentEditor = page
.frameLocator("iframe")
- .last()
.locator(".CodeMirror textarea");
await commentEditor.focus();
await commentEditor.pressSequentially(
@@ -492,7 +491,7 @@ test.describe("Wallet is connected", () => {
);
await pauseIfVideoRecording(page);
- const iframe = page.frameLocator("iframe").last();
+ const iframe = page.frameLocator("iframe");
const liFrameLocators = iframe.frameLocator(
'ul[id="mentiondropdown"] > li'
);
diff --git a/playwright-tests/tests/infrastructure/infrastructure.near.spec.js b/playwright-tests/tests/infrastructure/infrastructure.near.spec.js
index 22347058f..756ae63ac 100644
--- a/playwright-tests/tests/infrastructure/infrastructure.near.spec.js
+++ b/playwright-tests/tests/infrastructure/infrastructure.near.spec.js
@@ -11,7 +11,7 @@ test.describe("Wallet is connected", () => {
await expect(aboutHeaderLink).toBeVisible();
await aboutHeaderLink.click();
await expect(
- page.frameLocator("iframe").getByRole("heading", { name: "Introduction" })
+ page.getByRole("heading", { name: "Introduction" })
).toBeVisible();
const proposalsHeaderLink = await page.getByRole("link", {
diff --git a/playwright-tests/tests/infrastructure/proposal.spec.js b/playwright-tests/tests/infrastructure/proposal.spec.js
index b28b0bcf2..6805815ba 100644
--- a/playwright-tests/tests/infrastructure/proposal.spec.js
+++ b/playwright-tests/tests/infrastructure/proposal.spec.js
@@ -167,12 +167,12 @@ test.describe("Wallet is connected as admin", () => {
await createProposal(page, false);
});
- test("should show relevant users in mention autocomplete", async ({
+ test("should show relevant users in mention autocomplete and correct name and image in viewer", async ({
page,
account,
}) => {
+ test.setTimeout(120000);
await page.goto(`/${account}/widget/app?page=proposal&id=1`);
-
await page.waitForSelector(`iframe`, {
state: "visible",
});
@@ -196,7 +196,6 @@ test.describe("Wallet is connected as admin", () => {
const delay_milliseconds_between_keypress_when_typing = 0;
const commentEditor = page
.frameLocator("iframe")
- .last()
.locator(".CodeMirror textarea");
await commentEditor.focus();
await commentEditor.pressSequentially(
@@ -207,7 +206,7 @@ test.describe("Wallet is connected as admin", () => {
);
await pauseIfVideoRecording(page);
- const iframe = page.frameLocator("iframe").last();
+ const iframe = page.frameLocator("iframe");
const liFrameLocators = iframe.frameLocator(
'ul[id="mentiondropdown"] > li'
);
@@ -227,5 +226,71 @@ test.describe("Wallet is connected as admin", () => {
// When I manually test, it shows the correct 4 users
expect(mentionSuggestions.slice(0, 4)).toEqual(expected);
await pauseIfVideoRecording(page);
+
+ await page
+ .frameLocator("iframe")
+ .getByRole("button", { name: "hemera.near" })
+ .click();
+ await commentEditor.pressSequentially(" test");
+ await page.waitForTimeout(1000);
+ await page.getByRole("button", { name: "Preview" }).click();
+ await page.waitForTimeout(10_000);
+ const accountLink = page
+ .locator(".compose-preview")
+ .locator("div[data-component='mob.near/widget/ProfileImage']");
+ await expect(accountLink).toBeVisible({ timeout: 20_000 });
+ accountLink.click();
+ await page.waitForNavigation();
+ await expect(page).toHaveURL(
+ /mob\.near\/widget\/ProfilePage\?accountId=hemera\.near/
+ );
+ });
+
+ test("should show links in markdown viewer", async ({ page, account }) => {
+ test.setTimeout(120000);
+ await page.goto(`/${account}/widget/app?page=proposal&id=1`);
+ await page.goto(`/${account}/widget/app?page=proposal&id=1`);
+ await page.waitForSelector(`iframe`, {
+ state: "visible",
+ });
+
+ const proposal = page.getByRole("link", { name: "hemera.near" }).first();
+ await proposal.waitFor();
+ await proposal.scrollIntoViewIfNeeded();
+
+ const comment = page
+ .getByRole("link", { name: "trechriron71.near" })
+ .first();
+ await comment.waitFor();
+ await comment.scrollIntoViewIfNeeded();
+
+ const heading = page.getByText("Add a comment");
+ await heading.waitFor();
+ await heading.scrollIntoViewIfNeeded();
+
+ await page.waitForTimeout(5000);
+
+ const delay_milliseconds_between_keypress_when_typing = 0;
+ const commentEditor = page
+ .frameLocator("iframe")
+ .locator(".CodeMirror textarea");
+ await commentEditor.focus();
+ await commentEditor.pressSequentially(
+ `Adding a test [link](https://www.google.com/)`,
+ {
+ delay: delay_milliseconds_between_keypress_when_typing,
+ }
+ );
+ await page.waitForTimeout(1000);
+ await page.getByRole("button", { name: "Preview" }).click();
+
+ // make sure links open in new tab
+ const link = await page.getByRole("link", { name: "link" });
+ expect(link).toBeVisible();
+ link.click();
+ const pagePromise = page.waitForEvent("popup");
+ const newTab = await pagePromise;
+ await newTab.waitForLoadState();
+ await expect(newTab).toHaveURL("https://www.google.com");
});
});
diff --git a/playwright-tests/tests/other/feed.dontaskagain.spec.js b/playwright-tests/tests/other/feed.dontaskagain.spec.js
index 08327a3fd..1b18713b1 100644
--- a/playwright-tests/tests/other/feed.dontaskagain.spec.js
+++ b/playwright-tests/tests/other/feed.dontaskagain.spec.js
@@ -42,7 +42,6 @@ test.describe("Wallet is connected with devhub access key", () => {
const commentArea = await page
.frameLocator("iframe")
- .last()
.locator(".CodeMirror textarea");
await commentArea.focus();
await commentArea.fill("Some comment");
@@ -159,7 +158,7 @@ test.describe("Wallet is connected with devhub access key", () => {
await pauseIfVideoRecording(page);
await page.waitForTimeout(10_000);
const commentArea = await page
- .frameLocator("#accordion2261 iframe")
+ .frameLocator("iframe")
.locator(".CodeMirror textarea");
await commentArea.focus();
await page.waitForTimeout(100);
@@ -222,7 +221,6 @@ test.describe("Wallet is connected", () => {
const commentArea = await page
.frameLocator("iframe")
- .last()
.locator(".CodeMirror textarea");
await commentArea.focus();
await commentArea.fill("Some comment");
diff --git a/playwright-tests/tests/proposal/comment.spec.js b/playwright-tests/tests/proposal/comment.spec.js
index 8414ad788..0dde423de 100644
--- a/playwright-tests/tests/proposal/comment.spec.js
+++ b/playwright-tests/tests/proposal/comment.spec.js
@@ -35,7 +35,6 @@ test.describe("Don't ask again enabled", () => {
const delay_milliseconds_between_keypress_when_typing = 0;
const commentArea = await page
.frameLocator("iframe")
- .last()
.locator(".CodeMirror textarea");
await commentArea.focus({ timeout: 20_000 });
const text = "Comment testing";
@@ -83,10 +82,10 @@ test.describe("Don't ask again enabled", () => {
);
const commentButton = await page.getByRole("button", { name: "Comment" });
await expect(commentButton).toBeAttached();
- await commentButton.scrollIntoViewIfNeeded();
+ await commentButton.scrollIntoViewIfNeeded({ timeout: 10_000 });
await commentButton.click();
await expect(
- await page.frameLocator("iframe").last().locator(".CodeMirror")
+ await page.frameLocator("iframe").locator(".CodeMirror")
).toContainText(text);
const loadingIndicator = await page.locator(".comment-btn-spinner");
@@ -101,10 +100,10 @@ test.describe("Don't ask again enabled", () => {
await expect(transaction_successful_toast).not.toBeAttached();
await expect(
- await page.frameLocator("iframe").last().locator(".CodeMirror")
+ await page.frameLocator("iframe").locator(".CodeMirror")
).not.toContainText(text);
await expect(
- await page.frameLocator("iframe").last().locator(".CodeMirror")
+ await page.frameLocator("iframe").locator(".CodeMirror")
).toContainText("Add your comment here...");
await pauseIfVideoRecording(page);
});
@@ -131,7 +130,6 @@ test.describe("Don't ask again enabled", () => {
const commentArea = await page
.frameLocator("iframe")
- .last()
.locator(".CodeMirror textarea");
await commentArea.focus();
await page.waitForTimeout(100);
@@ -250,10 +248,10 @@ test.describe("Don't ask again enabled", () => {
timeout: 10000,
});
await expect(
- await page.frameLocator("iframe").last().locator(".CodeMirror")
+ await page.frameLocator("iframe").locator(".CodeMirror")
).not.toContainText(commentText);
await expect(
- await page.frameLocator("iframe").last().locator(".CodeMirror")
+ await page.frameLocator("iframe").locator(".CodeMirror")
).toContainText("Add your comment here...");
const submittedTransactionJsonObject =
@@ -262,9 +260,8 @@ test.describe("Don't ask again enabled", () => {
submittedTransactionJsonObject.data["petersalomonsen.near"].post.comment
);
expect(submittedComment.text).toEqual(commentText);
- let commentElement = await page
- .frameLocator("#theorinear121684809 iframe")
- .locator("#content");
+ let commentElement = await page.locator("#theorinear121684809 div").nth(4);
+
await expect(commentElement).toBeVisible({ timeout: 30_000 });
await expect(commentElement).toContainText(
"Typically, funds are disbursed within 10 business days, but the timeline can vary depending on the project's complexity and paperwork. Your DevDAO Moderator will keep you updated.",
@@ -273,9 +270,7 @@ test.describe("Don't ask again enabled", () => {
await page.reload();
- commentElement = await page
- .frameLocator("#theorinear121684809 iframe")
- .locator("#content");
+ commentElement = await page.locator("#theorinear121684809 div").nth(4);
await expect(commentElement).toBeVisible({ timeout: 30_000 });
await expect(commentElement).toContainText(
"Typically, funds are disbursed within 10 business days, but the timeline can vary depending on the project's complexity and paperwork. Your DevDAO Moderator will keep you updated.",
@@ -290,7 +285,7 @@ test.describe("Don't ask again enabled", () => {
await page.waitForTimeout(5000);
await expect(
- await page.frameLocator("iframe").last().locator(".CodeMirror")
+ await page.frameLocator("iframe").locator(".CodeMirror")
).toContainText("Add your comment here...");
await pauseIfVideoRecording(page);
diff --git a/playwright-tests/tests/sunset/feed.spec.js b/playwright-tests/tests/sunset/feed.spec.js
index bf49907c2..b35209477 100644
--- a/playwright-tests/tests/sunset/feed.spec.js
+++ b/playwright-tests/tests/sunset/feed.spec.js
@@ -143,7 +143,6 @@ test.describe("Wallet is connected", () => {
await page.getByRole("button", { name: "Comment" }).click();
await page
.frameLocator("iframe")
- .last()
.locator(".CodeMirror textarea")
.fill("The comment to the idea");
diff --git a/playwright-tests/tests/sunset/funding.spec.js b/playwright-tests/tests/sunset/funding.spec.js
index a4b0657f4..c3467ab34 100644
--- a/playwright-tests/tests/sunset/funding.spec.js
+++ b/playwright-tests/tests/sunset/funding.spec.js
@@ -122,7 +122,7 @@ test.describe("Wallet is connected by moderator", () => {
await page.getByLabel("Select currency").selectOption("USDC");
const descriptionInput = page
- .frameLocator("#accordion2586 iframe")
+ .frameLocator("iframe")
.locator(".CodeMirror textarea");
await descriptionInput.focus();
await page.waitForTimeout(100);