@@ -30,8 +30,8 @@ const formErrors = {
3030 constitutionalUrl : "prop-constitution-url-text-error" ,
3131 guardrailsScriptUrl : "prop-guardrails-script-url-input-error" ,
3232 link : "link-0-url-input-error" ,
33- majorError : "major-error" ,
34- minorError : "minor-error"
33+ majorError : "major-error" ,
34+ minorError : "minor-error" ,
3535} ;
3636
3737export default class ProposalSubmissionPage {
@@ -63,9 +63,7 @@ export default class ProposalSubmissionPage {
6363 readonly motionOfNoConfidenceBtn = this . page . getByTestId (
6464 "motion of no confidence-button"
6565 ) ;
66- readonly hardForkBtn = this . page . getByTestId (
67- "hard fork-button"
68- )
66+ readonly hardForkBtn = this . page . getByTestId ( "hard fork-button" ) ;
6967 readonly editSubmissionButton = this . page . getByTestId (
7068 "edit-submission-button"
7169 ) ;
@@ -106,10 +104,12 @@ export default class ProposalSubmissionPage {
106104 readonly closeDraftSuccessModalBtn = this . page . getByTestId ( "close-button" ) ;
107105 readonly linkTextInput = this . page . getByTestId ( "link-0-text-input" ) ;
108106 readonly linkUrlInput = this . page . getByTestId ( "link-0-url-input" ) ;
109- readonly previousGAHashInput = this . page . getByTestId ( "previous-ga-hash-input" ) ;
107+ readonly previousGAHashInput = this . page . getByTestId (
108+ "previous-ga-hash-input"
109+ ) ;
110110 readonly previousGAIdInput = this . page . getByTestId ( "previous-ga-id-input" ) ;
111- readonly majorInput = this . page . getByTestId ( "major-input" )
112- readonly minorInput = this . page . getByTestId ( "minor-input" )
111+ readonly majorInput = this . page . getByTestId ( "major-input" ) ;
112+ readonly minorInput = this . page . getByTestId ( "minor-input" ) ;
113113
114114 // content
115115 readonly governanceActionTypeContent = this . page . getByTestId (
@@ -134,8 +134,8 @@ export default class ProposalSubmissionPage {
134134 ) ;
135135 readonly linkTextContent = this . page . getByTestId ( "link-0-text-content" ) ;
136136 readonly linkUrlContent = this . page . getByTestId ( "link-0-url-content" ) ;
137- readonly majorVersionContent = this . page . getByTestId ( "major-version-content" )
138- readonly minorVersionContent = this . page . getByTestId ( "minor-version-content" )
137+ readonly majorVersionContent = this . page . getByTestId ( "major-version-content" ) ;
138+ readonly minorVersionContent = this . page . getByTestId ( "minor-version-content" ) ;
139139
140140 constructor ( private readonly page : Page ) { }
141141
@@ -184,14 +184,13 @@ export default class ProposalSubmissionPage {
184184 await this . fillProposalLinks ( governanceProposal . proposal_links ) ;
185185 }
186186
187- if ( governanceProposal . gov_action_type_id == 4 ) {
188- await this . fillHardForkFields ( governanceProposal )
189- }
187+ if ( governanceProposal . gov_action_type_id == 4 ) {
188+ await this . fillHardForkFields ( governanceProposal ) ;
189+ }
190190 }
191191
192192 async fillupForm ( governanceProposal : ProposalCreateRequest ) {
193-
194- console . log ( governanceProposal . gov_action_type_id )
193+ console . log ( governanceProposal . gov_action_type_id ) ;
195194 await this . governanceActionType . click ( ) ;
196195
197196 if ( governanceProposal . gov_action_type_id === 0 ) {
@@ -206,7 +205,7 @@ export default class ProposalSubmissionPage {
206205 } else if ( governanceProposal . gov_action_type_id === 3 ) {
207206 await this . motionOfNoConfidenceBtn . click ( ) ;
208207 } else {
209- await this . hardForkBtn . click ( )
208+ await this . hardForkBtn . click ( ) ;
210209 }
211210
212211 await this . fillupFormWithTypeSelected ( governanceProposal ) ;
@@ -257,9 +256,9 @@ export default class ProposalSubmissionPage {
257256 }
258257 }
259258
260- async fillHardForkFields ( hardForkProposal : ProposalCreateRequest ) {
261- await this . minorInput . fill ( hardForkProposal . prop_min_version . toString ( ) )
262- await this . majorInput . fill ( hardForkProposal . prop_major_version . toString ( ) )
259+ async fillHardForkFields ( hardForkProposal : ProposalCreateRequest ) {
260+ await this . minorInput . fill ( hardForkProposal . prop_min_version . toString ( ) ) ;
261+ await this . majorInput . fill ( hardForkProposal . prop_major_version . toString ( ) ) ;
263262 }
264263
265264 async getAllDrafts ( ) {
@@ -378,15 +377,15 @@ export default class ProposalSubmissionPage {
378377 . isVisible ( ) ;
379378
380379 await expect ( this . page . getByTestId ( formErrors . majorError ) , {
381- message : isMajorErrorVisible
382- ? ' Major version error should be hidden'
383- : ' Major version error is correctly hidden'
380+ message : isMajorErrorVisible
381+ ? " Major version error should be hidden"
382+ : " Major version error is correctly hidden" ,
384383 } ) . toBeHidden ( ) ;
385384
386385 await expect ( this . page . getByTestId ( formErrors . minorError ) , {
387- message : isMinorErrorVisible
388- ? ' Minor version error should be hidden'
389- : ' Minor version error is correctly hidden'
386+ message : isMinorErrorVisible
387+ ? " Minor version error should be hidden"
388+ : " Minor version error is correctly hidden" ,
390389 } ) . toBeHidden ( ) ;
391390 }
392391
@@ -502,9 +501,9 @@ export default class ProposalSubmissionPage {
502501 } ) . toBeVisible ( ) ;
503502 }
504503
505- if ( governanceProposal . gov_action_type_id === 4 ) {
506- await expect ( this . page . getByTestId ( formErrors . majorError ) ) . toBeVisible ( )
507- await expect ( this . page . getByTestId ( formErrors . minorError ) ) . toBeVisible ( )
504+ if ( governanceProposal . gov_action_type_id === 4 ) {
505+ await expect ( this . page . getByTestId ( formErrors . majorError ) ) . toBeVisible ( ) ;
506+ await expect ( this . page . getByTestId ( formErrors . minorError ) ) . toBeVisible ( ) ;
508507 }
509508
510509 await expect ( this . continueBtn ) . toBeDisabled ( ) ;
@@ -562,9 +561,13 @@ export default class ProposalSubmissionPage {
562561 }
563562 }
564563 }
565- if ( proposalType == ProposalType . hardFork ) {
566- proposal . prop_min_version = faker . number . float ( { min :0 , max :100 } ) . toString ( )
567- proposal . prop_major_version = faker . number . float ( { min :0 , max :100 } ) . toString ( )
564+ if ( proposalType == ProposalType . hardFork ) {
565+ proposal . prop_min_version = faker . number
566+ . float ( { min : 0 , max : 100 } )
567+ . toString ( ) ;
568+ proposal . prop_major_version = faker . number
569+ . float ( { min : 0 , max : 100 } )
570+ . toString ( ) ;
568571 }
569572
570573 return proposal ;
@@ -602,12 +605,11 @@ export default class ProposalSubmissionPage {
602605 proposal . prop_guardrails_script_hash = faker . string . alphanumeric ( 64 ) ;
603606 }
604607
605- if ( proposalType === ProposalType . hardFork ) {
606- proposal . prop_min_version = invalid . amount ( )
607- proposal . prop_major_version = invalid . amount ( )
608+ if ( proposalType === ProposalType . hardFork ) {
609+ proposal . prop_min_version = invalid . amount ( ) ;
610+ proposal . prop_major_version = invalid . amount ( ) ;
608611 }
609612
610-
611613 return proposal ;
612614 }
613615
0 commit comments