@@ -8,17 +8,17 @@ import BudgetDiscussionPage from "@pages/budgetDiscussionPage";
88import { expect , Page } from "@playwright/test" ;
99import walletManager from "lib/walletManager" ;
1010import { valid as mockValid } from "@mock/index" ;
11+ import { StaticWallet } from "@types" ;
1112
1213test . beforeEach ( async ( ) => {
1314 await setAllureEpic ( "11. Proposal Budget" ) ;
1415} ) ;
1516
1617test . describe ( "Budget proposal dRep behaviour" , ( ) => {
1718 let budgetDiscussionDetailsPage : BudgetDiscussionDetailsPage ;
18- let dRepId : string ;
19+ let wallet : StaticWallet ;
1920 test . beforeEach ( async ( { browser, page } ) => {
20- const wallet = await walletManager . popWallet ( "registeredDRep" ) ;
21- dRepId = wallet . dRepId ;
21+ wallet = await walletManager . popWallet ( "registeredDRep" ) ;
2222
2323 const tempDRepAuth = await createTempDRepAuth ( page , wallet ) ;
2424
@@ -40,7 +40,7 @@ test.describe("Budget proposal dRep behaviour", () => {
4040 test ( "11K. Should allow registered DRep to vote on a proposal" , async ( ) => {
4141 const pollVotes = [ "Yes" , "No" ] ;
4242 const choice = faker . helpers . arrayElement ( pollVotes ) ;
43- console . log ( choice ) ;
43+
4444 await budgetDiscussionDetailsPage . voteOnPoll ( choice ) ;
4545
4646 await expect ( budgetDiscussionDetailsPage . pollYesBtn ) . not . toBeVisible ( ) ;
@@ -62,7 +62,7 @@ test.describe("Budget proposal dRep behaviour", () => {
6262 test ( "11L. Should allow registered DRep to change vote on a proposal" , async ( ) => {
6363 const pollVotes = [ "Yes" , "No" ] ;
6464 const choice = faker . helpers . arrayElement ( pollVotes ) ;
65- console . log ( choice ) ;
65+
6666 await budgetDiscussionDetailsPage . voteOnPoll ( choice ) ;
6767 await budgetDiscussionDetailsPage . changePollVote ( ) ;
6868
@@ -83,5 +83,31 @@ test.describe("Budget proposal dRep behaviour", () => {
8383 )
8484 ) . toHaveText ( `${ oppositeVote } : (100%)` ) ;
8585 } ) ;
86- test ( "11M. Should display DRep tag, name and ID when a registered DRep comments on a proposal" , async ( { } ) => { } ) ;
86+
87+ test ( "11M. Should display DRep tag, name and ID when a registered DRep comments on a proposal" , async ( ) => {
88+ const comment = faker . lorem . paragraph ( 2 ) ;
89+ await budgetDiscussionDetailsPage . addComment ( comment ) ;
90+
91+ await expect (
92+ budgetDiscussionDetailsPage . currentPage
93+ . locator ( '[data-testid^="comment-"][data-testid$="-content"]' )
94+ . first ( )
95+ ) . toHaveText ( comment ) ;
96+
97+ const dRepCommentedCard = budgetDiscussionDetailsPage . currentPage
98+ . locator ( '[data-testid^="comment-"][data-testid$="-content-card"]' )
99+ . first ( ) ;
100+
101+ await expect (
102+ dRepCommentedCard . getByText ( "DRep" , { exact : true } )
103+ ) . toBeVisible ( ) ;
104+
105+ await expect ( dRepCommentedCard . getByTestId ( "given-name" ) ) . toHaveText (
106+ wallet . givenName
107+ ) ;
108+
109+ await expect ( dRepCommentedCard . getByTestId ( "drep-id" ) ) . toHaveText (
110+ wallet . dRepId
111+ ) ;
112+ } ) ;
87113} ) ;
0 commit comments