@@ -73,4 +73,28 @@ describe("The Ad Hoc Validate Check Data page", () => {
7373 cy . contains ( "a" , "View Progress and Reports" ) . click ( ) ;
7474 cy . contains ( "Failed to load iati data please try again later" ) ;
7575 } ) ;
76+ it ( "displays error message uploading a file when validator-services is in maintenance mode" , ( ) => {
77+ cy . intercept ( "POST" , "https://*api.iatistandard.org/vs/pvt/adhoc/upload?*" , {
78+ statusCode : 503 ,
79+ body : { message : "Validator services is in read-only mode for maintenance" } ,
80+ } ) ;
81+ cy . get ( "input[type=file" ) . selectFile ( "cypress/fixtures/iati-act-no-errors.xml" , { force : true } ) ;
82+ cy . contains ( "iati-act-no-errors.xml" ) ;
83+ cy . contains ( "button" , "Upload" ) . should ( "not.be.disabled" ) . click ( ) ;
84+ cy . contains ( "Validator services is in read-only mode for maintenance" , { timeout : 20000 } ) ;
85+ cy . contains ( "a" , "View Progress and Reports" ) . parent ( ) . should ( "have.class" , "pointer-events-none" ) ;
86+ } ) ;
87+ it ( "displays error message fetching a url when validator-services is in maintenance mode" , ( ) => {
88+ cy . intercept ( "POST" , "https://*api.iatistandard.org/vs/pvt/adhoc/url?**/**" , {
89+ statusCode : 503 ,
90+ body : { message : "Validator services is in read-only mode for maintenance" } ,
91+ } ) ;
92+ cy . contains ( "URL to a remote file" ) . click ( ) ;
93+ cy . get ( "#url" ) . type (
94+ "https://raw.githubusercontent.com/IATI/IATI-Extra-Documentation/version-2.03/en/activity-standard/activity-standard.xml" ,
95+ ) ;
96+ cy . contains ( "button" , "Fetch" ) . should ( "not.be.disabled" ) . click ( ) ;
97+ cy . contains ( "Validator services is in read-only mode for maintenance" , { timeout : 20000 } ) ;
98+ cy . contains ( "a" , "View Progress and Reports" ) . parent ( ) . should ( "have.class" , "pointer-events-none" ) ;
99+ } ) ;
76100} ) ;
0 commit comments