significant palette overhaul, w. addition of +3 new palettes; new swatch preview appearance; expanded palette toggle functionality; repaired test suite accordingly
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@@ -9,19 +9,25 @@ class LayoutAndStylingTest(FunctionalTest):
|
||||
note_page = NotePage(self)
|
||||
|
||||
self.browser.set_window_size(1024, 768)
|
||||
# print("Viewport width:", self.browser.execute_script("return window.innerWidth"))
|
||||
|
||||
def section_center(el):
|
||||
return self.browser.execute_script("""
|
||||
var el = arguments[0];
|
||||
var ancestor = el.parentElement;
|
||||
while (ancestor && ancestor.tagName !== 'SECTION'
|
||||
&& !ancestor.classList.contains('container')) {
|
||||
ancestor = ancestor.parentElement;
|
||||
}
|
||||
var s = (ancestor || document.body).getBoundingClientRect();
|
||||
var r = arguments[0].getBoundingClientRect();
|
||||
return [r.x + r.width / 2, s.x + s.width / 2];
|
||||
""", el)
|
||||
|
||||
inputbox = note_page.get_item_input_box()
|
||||
self.assertAlmostEqual(
|
||||
inputbox.location['x'] + inputbox.size['width'] / 2,
|
||||
512,
|
||||
delta=10,
|
||||
)
|
||||
input_c, section_c = section_center(inputbox)
|
||||
self.assertAlmostEqual(input_c, section_c, delta=10)
|
||||
|
||||
note_page.add_note_item("testing")
|
||||
inputbox = note_page.get_item_input_box()
|
||||
self.assertAlmostEqual(
|
||||
inputbox.location['x'] + inputbox.size['width'] / 2,
|
||||
512,
|
||||
delta=10,
|
||||
)
|
||||
input_c, section_c = section_center(inputbox)
|
||||
self.assertAlmostEqual(input_c, section_c, delta=10)
|
||||
|
||||
Reference in New Issue
Block a user