another attempt to unclog pipeline; this time a slight sleep timeout used to accomodate headless browser resize flush
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
This commit is contained in:
@@ -621,7 +621,6 @@ class RoleSelectTrayTest(FunctionalTest):
|
||||
# T1 — Portrait, position 1: empty tray, card at row 1 col 1 #
|
||||
# ------------------------------------------------------------------ #
|
||||
|
||||
@unittest.skip("tray-open-on-role-select not yet implemented")
|
||||
def test_portrait_first_role_card_enters_grid_position_zero(self):
|
||||
"""Portrait, slot 1: after confirming a role, a .tray-role-card element
|
||||
appears as the first child of #id_tray_grid (topmost-leftmost cell), and
|
||||
@@ -673,7 +672,6 @@ class RoleSelectTrayTest(FunctionalTest):
|
||||
# T2 — Portrait, position 2: col 1 full, 8th item overflows to col 2 #
|
||||
# ------------------------------------------------------------------ #
|
||||
|
||||
@unittest.skip("tray-open-on-role-select not yet implemented")
|
||||
def test_portrait_second_card_prepended_pushes_eighth_item_to_col_2(self):
|
||||
"""Portrait, slot 2: col 1 already holds slot 1's role card (position 0)
|
||||
plus 7 tray-cells (positions 1-7), filling the column. After slot 2
|
||||
@@ -697,18 +695,23 @@ class RoleSelectTrayTest(FunctionalTest):
|
||||
|
||||
self._select_role()
|
||||
|
||||
# 1. New card is first child.
|
||||
# 1. Wait for grid to grow (fetch .then() is async).
|
||||
self.wait_for(
|
||||
lambda: self.browser.find_element(
|
||||
By.CSS_SELECTOR, "#id_tray_grid .tray-role-card:first-child"
|
||||
lambda: self.assertEqual(
|
||||
self.browser.execute_script(
|
||||
"return document.getElementById('id_tray_grid').children.length"
|
||||
),
|
||||
grid_before + 1,
|
||||
)
|
||||
)
|
||||
grid_after = grid_before + 1
|
||||
|
||||
# 2. Grid now has 10 items (one more than before).
|
||||
grid_after = self.browser.execute_script(
|
||||
"return document.getElementById('id_tray_grid').children.length"
|
||||
)
|
||||
self.assertEqual(grid_after, grid_before + 1)
|
||||
# 2. New tray-role-card is the first child.
|
||||
is_first = self.browser.execute_script("""
|
||||
var card = document.querySelector('#id_tray_grid .tray-role-card');
|
||||
return card !== null && card === card.parentElement.firstElementChild;
|
||||
""")
|
||||
self.assertTrue(is_first, "Newest role card should be first child")
|
||||
|
||||
# 3. The item now at position 8 (col 2, row 1) is a tray-cell —
|
||||
# it was the 8th item in col 1 and has been displaced.
|
||||
@@ -731,7 +734,6 @@ class RoleSelectTrayTest(FunctionalTest):
|
||||
# T3 — Landscape, position 3: row 1 full, rightmost item enters row 2 #
|
||||
# ------------------------------------------------------------------ #
|
||||
|
||||
@unittest.skip("tray-open-on-role-select not yet implemented")
|
||||
def test_landscape_third_card_at_bottom_left_rightmost_overflows_to_row_2(self):
|
||||
"""Landscape, slot 3: row 1 (bottom, 8 cols) already holds 2 prior role
|
||||
cards + 6 tray-cells. After slot 3 confirms, new card at position 0
|
||||
@@ -759,18 +761,23 @@ class RoleSelectTrayTest(FunctionalTest):
|
||||
|
||||
self._select_role()
|
||||
|
||||
# 1. New card is first child — bottommost-leftmost in landscape.
|
||||
# 1. Wait for grid to grow (fetch .then() is async).
|
||||
self.wait_for(
|
||||
lambda: self.browser.find_element(
|
||||
By.CSS_SELECTOR, "#id_tray_grid .tray-role-card:first-child"
|
||||
lambda: self.assertEqual(
|
||||
self.browser.execute_script(
|
||||
"return document.getElementById('id_tray_grid').children.length"
|
||||
),
|
||||
grid_before + 1,
|
||||
)
|
||||
)
|
||||
grid_after = grid_before + 1
|
||||
|
||||
# 2. Grid grew by exactly one item.
|
||||
grid_after = self.browser.execute_script(
|
||||
"return document.getElementById('id_tray_grid').children.length"
|
||||
)
|
||||
self.assertEqual(grid_after, grid_before + 1)
|
||||
# 2. Newest tray-role-card is the first child — bottommost-leftmost in landscape.
|
||||
is_first = self.browser.execute_script("""
|
||||
var card = document.querySelector('#id_tray_grid .tray-role-card');
|
||||
return card !== null && card === card.parentElement.firstElementChild;
|
||||
""")
|
||||
self.assertTrue(is_first, "Newest role card should be first child")
|
||||
|
||||
# 3. Item at position 8 (row 2, col 1) is a tray-cell — it was the
|
||||
# rightmost item in row 1 (position 7) and has been displaced upward.
|
||||
|
||||
Reference in New Issue
Block a user