Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ears/board.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def section(title, key, selected, empty):
page = ('<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">'
'<title>PyAutoEars community board</title><style>' + theme.css('ears') + CSS + '</style></head><body><main>' +
'\n'.join(body) + '</main><script>' + theme.JS + script + '</script></body></html>')
return page, '\n'.join(md) + '\n'
return theme.section_layout(page), '\n'.join(md) + '\n'


SCRIPT = r"""
Expand Down
9 changes: 9 additions & 0 deletions tests/board_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ def main():
page.emulate_media(color_scheme=scheme)
assert not page.evaluate("document.documentElement.scrollWidth > innerWidth"), (width, scheme)
page.screenshot(path=str(output / f"synthetic-{width}-{scheme}.png"), full_page=True)
# Major sections start collapsed (PyAutoBrain#490); the nav card reveals its target.
sections = page.locator('details.board-section')
assert sections.count() == 3
assert sections.evaluate_all('(nodes) => nodes.every((d) => !d.open)')
assert not page.locator('#attention').is_visible()
page.locator('.board-nav-card[href="#attention"]').click()
page.wait_for_function("document.getElementById('attention').closest('details.board-section').open")
followup_topic = page.locator('#attention .topic').filter(has_text='New request on a closed discussion')
followup_topic.locator(':scope > summary').click()
assert 'Closed · Answered' in followup_topic.inner_text()
Expand Down Expand Up @@ -85,6 +92,8 @@ def main():
page.wait_for_function("document.getElementById('copy-status').textContent === 'Prompt copied'")
copied = page.evaluate("navigator.clipboard.readText()")
assert "community" in copied and "https://github.com/example/lib/issues/1" in copied
page.locator('.board-nav-card[href="#activity"]').click()
page.wait_for_function("document.getElementById('activity').closest('details.board-section').open")
page.locator('#activity .topic summary').first.click()
follow = page.get_by_role("button", name="Copy follow-through prompt").first
follow.click()
Expand Down
Loading