@@ -8,6 +8,7 @@ import { test } from "@fixtures/proposal";
88import { setAllureEpic } from "@helpers/allure" ;
99import { isBootStrapingPhase , skipIfNotHardFork } from "@helpers/cardano" ;
1010import { injectLogger } from "@helpers/page" ;
11+ import { extractProposalIdFromUrl } from "@helpers/string" ;
1112import { functionWaitedAssert } from "@helpers/waitedLoop" ;
1213import ProposalDiscussionDetailsPage from "@pages/proposalDiscussionDetailsPage" ;
1314import ProposalDiscussionPage from "@pages/proposalDiscussionPage" ;
@@ -195,6 +196,31 @@ test("8S. Should restrict proposal creation on disconnected state", async ({
195196 await expect ( proposalDiscussionPage . proposalCreateBtn ) . not . toBeVisible ( ) ;
196197} ) ;
197198
199+ test ( "8E. Should share proposed governance action" , async ( {
200+ page,
201+ context,
202+ } ) => {
203+ await context . grantPermissions ( [ "clipboard-read" , "clipboard-write" ] ) ;
204+ const proposalDiscussionPage = new ProposalDiscussionPage ( page ) ;
205+ await proposalDiscussionPage . goto ( ) ;
206+
207+ await proposalDiscussionPage . viewFirstProposal ( ) ;
208+
209+ const currentPageUrl = page . url ( ) ;
210+ const proposalId = extractProposalIdFromUrl ( currentPageUrl ) ;
211+
212+ await page . getByTestId ( "share-button" ) . click ( ) ;
213+ await page . getByTestId ( "copy-link" ) . click ( ) ;
214+ await expect ( page . getByTestId ( "copy-link-text" ) ) . toBeVisible ( ) ;
215+
216+ const copiedTextDRepDirectory = await page . evaluate ( ( ) =>
217+ navigator . clipboard . readText ( )
218+ ) ;
219+ const expectedCopyUrl = `${ environments . frontendUrl } /proposal_discussion/${ proposalId } ` ;
220+
221+ expect ( copiedTextDRepDirectory ) . toEqual ( expectedCopyUrl ) ;
222+ } ) ;
223+
198224test . describe ( "Mocked proposal" , ( ) => {
199225 let proposalDiscussionDetailsPage : ProposalDiscussionDetailsPage ;
200226
@@ -221,24 +247,6 @@ test.describe("Mocked proposal", () => {
221247 await proposalDiscussionDetailsPage . goto ( mockProposal . data . id ) ;
222248 } ) ;
223249
224- test ( "8E. Should share proposed governance action" , async ( {
225- page,
226- context,
227- } ) => {
228- await context . grantPermissions ( [ "clipboard-read" , "clipboard-write" ] ) ;
229-
230- await page . getByTestId ( "share-button" ) . click ( ) ;
231- await page . getByTestId ( "copy-link" ) . click ( ) ;
232- await expect ( page . getByTestId ( "copy-link-text" ) ) . toBeVisible ( ) ;
233-
234- const copiedTextDRepDirectory = await page . evaluate ( ( ) =>
235- navigator . clipboard . readText ( )
236- ) ;
237- const expectedCopyUrl = `${ environments . frontendUrl } /proposal_discussion/${ mockProposal . data . id } ` ;
238-
239- expect ( copiedTextDRepDirectory ) . toEqual ( expectedCopyUrl ) ;
240- } ) ;
241-
242250 test ( "8I. Should disable poll voting functionality." , async ( ) => {
243251 await expect ( proposalDiscussionDetailsPage . pollVoteCard ) . not . toBeVisible ( ) ;
244252 await expect ( proposalDiscussionDetailsPage . pollYesBtn ) . not . toBeVisible ( ) ;
0 commit comments