From feb6a02b7fbbc9a503ee1e3a08fe70d1fd2aa4af Mon Sep 17 00:00:00 2001 From: Megha-Dev-19 <100185149+Megha-Dev-19@users.noreply.github.com> Date: Mon, 18 Dec 2023 19:13:08 +0530 Subject: [PATCH] Fix telegram string and array issue (#571) * fix solution action * fix telegram string and array issue * update telegram_handle * fix handle and URL * fix tests * prettier update * fix tests * prettier update --- playwright-tests/tests/community.spec.js | 10 ++-- src/devhub/entity/addon/telegram/Viewer.jsx | 59 +++++++++++---------- src/devhub/page/community/index.jsx | 22 +++++--- src/devhub/page/create.jsx | 6 ++- 4 files changed, 57 insertions(+), 40 deletions(-) diff --git a/playwright-tests/tests/community.spec.js b/playwright-tests/tests/community.spec.js index c42ddc331..fc29c3db9 100644 --- a/playwright-tests/tests/community.spec.js +++ b/playwright-tests/tests/community.spec.js @@ -1,12 +1,10 @@ import { test, expect } from "@playwright/test"; test("should load a community page if handle exists", async ({ page }) => { - await page.goto( - "/devgovgigs.near/widget/app?page=community&handle=devhub-test" - ); + await page.goto("/devhub.near/widget/app?page=community&handle=devhub-test"); // Using the that wraps the tabs to identify a community page loaded - const communityTabSelector = `a[href^="/devgovgigs.near/widget/app?page=community&handle=devhub-test&tab="]`; + const communityTabSelector = `a[href^="/devhub.near/widget/app?page=community&handle=devhub-test&tab="]`; // Wait for the tab to be visible await page.waitForSelector(communityTabSelector, { @@ -44,7 +42,7 @@ test.describe("Wallet is connected", () => { page, }) => { await page.goto( - "/devgovgigs.near/widget/app?page=community&handle=devhub-test" + "/devhub.near/widget/app?page=community&handle=devhub-test" ); const postButtonSelector = 'a:has-text("Post")'; @@ -61,7 +59,7 @@ test.describe("Wallet is connected", () => { // Verify that the URL is the expected one. expect(page.url()).toBe( - "http://localhost:8080/devgovgigs.near/widget/app?page=create&labels=devhub-test" + "http://localhost:8080/devhub.near/widget/app?page=create&labels=devhub-test" ); // Wait for the Typeahead field to render. diff --git a/src/devhub/entity/addon/telegram/Viewer.jsx b/src/devhub/entity/addon/telegram/Viewer.jsx index 4959daf74..122fd32a4 100644 --- a/src/devhub/entity/addon/telegram/Viewer.jsx +++ b/src/devhub/entity/addon/telegram/Viewer.jsx @@ -18,34 +18,39 @@ if (!handles || handles.length === 0) { } else { return (