fix: remove duplicate atlas toggle button markup (#1442)
This commit is contained in:
21
tests/test_hud_toggle_buttons.py
Normal file
21
tests/test_hud_toggle_buttons.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def _hud_button_block() -> str:
|
||||
text = (Path(__file__).resolve().parents[1] / 'index.html').read_text(encoding='utf-8')
|
||||
start = text.index('<!-- Top Right: Agent Log, Atlas & SOUL Toggle -->')
|
||||
end = text.index('<div id="bannerlord-status"')
|
||||
return text[start:end]
|
||||
|
||||
|
||||
def test_hud_toggle_buttons_have_unique_ids():
|
||||
block = _hud_button_block()
|
||||
assert block.count('id="atlas-toggle-btn"') == 1
|
||||
assert block.count('id="soul-toggle-btn"') == 1
|
||||
assert block.count('id="mode-toggle-btn"') == 1
|
||||
|
||||
|
||||
def test_hud_toggle_buttons_are_balanced_and_closed():
|
||||
block = _hud_button_block()
|
||||
assert block.count('<button') == 3
|
||||
assert block.count('</button>') == 3
|
||||
Reference in New Issue
Block a user