@@ -760,30 +760,22 @@ def drag(dest, position):
760760 # --- invalid input reports without blanking the page ---------------
761761 page .click ("#tab-main" )
762762
763- def form_top ():
764- return page .evaluate (
765- "() => Math.round("
766- "document.querySelector('#panel-main .pc-section').getBoundingClientRect().top)"
767- )
768-
769- settled = form_top ()
770763 fill ("#readout-db_ram" , "32Zi" )
771764 check (page .locator ("#error" ).is_visible (), "an invalid size produced no error" )
772- # The slot is reserved: a message may not shove the page around.
773765 check (
774- form_top () == settled ,
775- f "the settings moved by { form_top () - settled } px when the message appeared " ,
766+ page . locator ( "#error" ). evaluate ( "el => el.closest('[role=tabpanel]') === null" ) ,
767+ "the shared error banner is inside a tab panel " ,
776768 )
777769 error_text = page .locator ("#error" ).inner_text ()
778770 check ("Unknown size unit" in error_text , f"unexpected error text: { error_text } " )
779771 check (
780772 page .evaluate (
781773 "() => Math.round("
782- "document.querySelector('#panel-main .pc-section ').getBoundingClientRect().top"
774+ "document.querySelector('.pc-top ').getBoundingClientRect().top"
783775 " - document.querySelector('#error').getBoundingClientRect().bottom)"
784776 )
785777 >= 8 ,
786- "the message sits flush against the settings below it " ,
778+ "the error banner is not above the page header with a gap " ,
787779 )
788780 # A result the current input did not produce must not stay on offer.
789781 check (
@@ -806,14 +798,16 @@ def form_top():
806798 page .locator ("#panel-calculation tbody tr" ).count () > 0 ,
807799 "the calculation was blanked as well" ,
808800 )
801+ for tab in ("calculation" , "advisories" , "overrides" , "diff" , "main" ):
802+ page .click (f"#tab-{ tab } " )
803+ check (page .locator ("#error" ).is_visible (), f"the error disappeared on { tab } " )
804+ check (
805+ page .locator ("[role=alert]:visible" ).count () == 1 ,
806+ f"the error banner is duplicated on { tab } " ,
807+ )
809808
810- page .click ("#tab-main" )
811809 fill ("#readout-db_ram" , "32Gi" )
812810 check (not page .locator ("#error" ).is_visible (), "the error stayed after a fix" )
813- check (
814- form_top () == settled ,
815- f"the settings moved by { form_top () - settled } px when the message went away" ,
816- )
817811 check (
818812 page .locator ("#main-output-panel-settings tbody tr" ).count () > 100 ,
819813 "the settings table did not come back after a fix" ,
0 commit comments