Reduce width to ensure that the name is wider and thus still triggering the scroll

This commit is contained in:
Guillaume Gomez 2024-07-19 18:32:11 +02:00
parent 063ed0f958
commit 590c01a5c5

View File

@ -8,34 +8,38 @@ fail-on-request-error: false
go-to: "file://" + |DOC_PATH| + "/lib2/long_trait/trait.ALongNameBecauseItHelpsTestingTheCurrentProblem.html" go-to: "file://" + |DOC_PATH| + "/lib2/long_trait/trait.ALongNameBecauseItHelpsTestingTheCurrentProblem.html"
// We set a fixed size so there is no chance of "random" resize. // We set a fixed size so there is no chance of "random" resize.
set-window-size: (1100, 800) set-window-size: (710, 800)
// Logically, the <body> scroll width should be the width of the window. // Logically, the <body> scroll width should be the width of the window.
assert-property: ("body", {"scrollWidth": "1100"}) assert-property: ("body", {"scrollWidth": "710"})
// However, since there is overflow in the type declaration, its scroll width is bigger. // We now check that the section width hasn't grown because of it.
assert-property: ("pre.item-decl", {"scrollWidth": "1324"}) assert-property: ("#main-content", {"scrollWidth": "450"})
// However, since there is overflow in the type declaration, its scroll width is bigger that "#main-content".
assert-property: ("pre.item-decl", {"scrollWidth": "585"})
// In the table-ish view on the module index, the name should not be wrapped more than necessary. // In the table-ish view on the module index, the name should not be wrapped more than necessary.
go-to: "file://" + |DOC_PATH| + "/lib2/too_long/index.html" go-to: "file://" + |DOC_PATH| + "/lib2/too_long/index.html"
// We'll ensure that items with short documentation have the same width. // We'll ensure that items with short documentation have the same width.
store-property: ("//*[@class='item-table']//*[@class='struct']/..", {"offsetWidth": offset_width}) store-property: ("//*[@class='item-table']//*[@class='struct']/..", {"offsetWidth": offset_width})
assert: |offset_width| == "277" assert: |offset_width| == "149"
assert-property: ("//*[@class='item-table']//*[@class='constant']/..", {"offsetWidth": |offset_width|}) assert-property: ("//*[@class='item-table']//*[@class='constant']/..", {"offsetWidth": |offset_width|})
// We now make the same check on type declaration... // We now make the same check on type declaration...
go-to: "file://" + |DOC_PATH| + "/lib2/too_long/type.ReallyLongTypeNameLongLongLong.html" go-to: "file://" + |DOC_PATH| + "/lib2/too_long/type.ReallyLongTypeNameLongLongLong.html"
assert-property: ("body", {"scrollWidth": "1100"}) assert-property: ("body", {"scrollWidth": "710"})
// Getting the width of the "<main>" element.
assert-property: ("main", {"scrollWidth": "510"})
// We now check that the section width hasn't grown because of it. // We now check that the section width hasn't grown because of it.
assert-property: ("#main-content", {"scrollWidth": "840"}) assert-property: ("#main-content", {"scrollWidth": "450"})
// And now checking that it has scrollable content. // And now checking that it has scrollable content.
assert-property: ("pre.item-decl", {"scrollWidth": "1103"}) assert-property: ("pre.item-decl", {"scrollWidth": "1103"})
// ... and constant. // ... and constant.
// On a sidenote, it also checks that the (very) long title isn't changing the docblock width. // On a sidenote, it also checks that the (very) long title isn't changing the docblock width.
go-to: "file://" + |DOC_PATH| + "/lib2/too_long/constant.ReallyLongTypeNameLongLongLongConstBecauseWhyNotAConstRightGigaGigaSupraLong.html" go-to: "file://" + |DOC_PATH| + "/lib2/too_long/constant.ReallyLongTypeNameLongLongLongConstBecauseWhyNotAConstRightGigaGigaSupraLong.html"
assert-property: ("body", {"scrollWidth": "1100"}) assert-property: ("body", {"scrollWidth": "710"})
// We now check that the section width hasn't grown because of it. // We now check that the section width hasn't grown because of it.
assert-property: ("#main-content", {"scrollWidth": "840"}) assert-property: ("#main-content", {"scrollWidth": "450"})
// And now checking that it has scrollable content. // And now checking that it has scrollable content.
assert-property: ("pre.item-decl", {"scrollWidth": "950"}) assert-property: ("pre.item-decl", {"scrollWidth": "950"})