fix FT note→post renames in test_sharing & test_layout_and_styling; note page layout polish
Some checks failed
ci/woodpecker/push/pyswiss Pipeline was successful
ci/woodpecker/push/main Pipeline failed

- test_sharing.py: NotePage→PostPage, MyNotesPage→MyPostsPage, add_note_item→add_post_line,
  share_note_with→share_post_with, get_note_owner→get_post_owner; navigate to /billboard/
- test_layout_and_styling.py: NotePage→PostPage, get_item_input_box→get_line_input_box,
  add_note_item→add_post_line; navigate to /billboard/
- my_notes.html: remove "My Notes" h2 heading
- _note.scss: .note-page padding 0.75rem 1.5rem; .note-don-doff top:-1rem (DON centers on
  corner), gap:0.4rem (tight like game kit); .note-item padding-left:1.25rem (left buffer)

Code architected by Disco DeDisco <discodedisco@outlook.com>
Git commit message Co-Authored-By:
Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Disco DeDisco
2026-04-23 01:55:12 -04:00
parent 214120ef2d
commit b86a4ddd73
4 changed files with 28 additions and 29 deletions

View File

@@ -1,12 +1,12 @@
from .base import FunctionalTest from .base import FunctionalTest
from .note_page import NotePage from .post_page import PostPage
class LayoutAndStylingTest(FunctionalTest): class LayoutAndStylingTest(FunctionalTest):
def test_layout_and_styling(self): def test_layout_and_styling(self):
self.create_pre_authenticated_session("disco@test.io") self.create_pre_authenticated_session("disco@test.io")
self.browser.get(self.live_server_url) self.browser.get(self.live_server_url + '/billboard/')
note_page = NotePage(self) post_page = PostPage(self)
self.browser.set_window_size(1024, 768) self.browser.set_window_size(1024, 768)
@@ -27,11 +27,11 @@ class LayoutAndStylingTest(FunctionalTest):
return [r.x + r.width / 2, s.x + pl + (s.width - pl - pr) / 2]; return [r.x + r.width / 2, s.x + pl + (s.width - pl - pr) / 2];
""", el) """, el)
inputbox = note_page.get_item_input_box() inputbox = post_page.get_line_input_box()
input_c, section_c = section_center(inputbox) input_c, section_c = section_center(inputbox)
self.assertAlmostEqual(input_c, section_c, delta=10) self.assertAlmostEqual(input_c, section_c, delta=10)
note_page.add_note_item("testing") post_page.add_post_line("testing")
inputbox = note_page.get_item_input_box() inputbox = post_page.get_line_input_box()
input_c, section_c = section_center(inputbox) input_c, section_c = section_center(inputbox)
self.assertAlmostEqual(input_c, section_c, delta=10) self.assertAlmostEqual(input_c, section_c, delta=10)

View File

@@ -6,8 +6,8 @@ from selenium import webdriver
from selenium.webdriver.common.by import By from selenium.webdriver.common.by import By
from .base import FunctionalTest from .base import FunctionalTest
from .note_page import NotePage from .post_page import PostPage
from .my_notes_page import MyNotesPage from .my_posts_page import MyPostsPage
# Helper fns # Helper fns
@@ -21,7 +21,7 @@ def quit_if_possible(browser):
# Test mdls # Test mdls
class SharingTest(FunctionalTest): class SharingTest(FunctionalTest):
@tag("two-browser") @tag("two-browser")
def test_can_share_a_note_with_another_user(self): def test_can_share_a_post_with_another_user(self):
self.create_pre_authenticated_session("disco@test.io") self.create_pre_authenticated_session("disco@test.io")
disco_browser = self.browser disco_browser = self.browser
self.addCleanup(lambda: quit_if_possible(disco_browser)) self.addCleanup(lambda: quit_if_possible(disco_browser))
@@ -35,40 +35,40 @@ class SharingTest(FunctionalTest):
self.create_pre_authenticated_session("alice@test.io") self.create_pre_authenticated_session("alice@test.io")
self.browser = disco_browser self.browser = disco_browser
self.browser.get(self.live_server_url) self.browser.get(self.live_server_url + '/billboard/')
note_page = NotePage(self).add_note_item("Send help") post_page = PostPage(self).add_post_line("Send help")
share_box = note_page.get_share_box() share_box = post_page.get_share_box()
self.assertEqual( self.assertEqual(
share_box.get_attribute("placeholder"), share_box.get_attribute("placeholder"),
"friend@example.com", "friend@example.com",
) )
note_page.share_note_with("alice@test.io") post_page.share_post_with("alice@test.io")
self.browser = ali_browser self.browser = ali_browser
MyNotesPage(self).go_to_my_notes_page("alice@test.io") MyPostsPage(self).go_to_my_posts_page("alice@test.io")
self.browser.find_element(By.LINK_TEXT, "Send help").click() self.browser.find_element(By.LINK_TEXT, "Send help").click()
self.wait_for( self.wait_for(
lambda: self.assertEqual(note_page.get_note_owner(), "disco@test.io") lambda: self.assertEqual(post_page.get_post_owner(), "disco@test.io")
) )
note_page.add_note_item("At your command, Disco King") post_page.add_post_line("At your command, Disco King")
self.browser = disco_browser self.browser = disco_browser
self.browser.refresh() self.browser.refresh()
note_page.wait_for_row_in_note_table("At your command, Disco King", 2) post_page.wait_for_row_in_post_table("At your command, Disco King", 2)
class NoteAccessTest(FunctionalTest): class PostAccessTest(FunctionalTest):
def test_stranger_cannot_access_owned_note(self): def test_stranger_cannot_access_owned_post(self):
self.create_pre_authenticated_session("disco@test.io") self.create_pre_authenticated_session("disco@test.io")
self.browser.get(self.live_server_url) self.browser.get(self.live_server_url + '/billboard/')
note_page = NotePage(self).add_note_item("private eye") PostPage(self).add_post_line("private eye")
note_url = self.browser.current_url post_url = self.browser.current_url
self.browser.delete_cookie(settings.SESSION_COOKIE_NAME) self.browser.delete_cookie(settings.SESSION_COOKIE_NAME)
self.browser.get(note_url) self.browser.get(post_url)
self.assertNotEqual(self.browser.current_url, note_url) self.assertNotEqual(self.browser.current_url, post_url)

View File

@@ -45,7 +45,7 @@
// ── Notes page ───────────────────────────────────────────────────────────── // ── Notes page ─────────────────────────────────────────────────────────────
.note-page { .note-page {
padding: 0.75rem; padding: 0.75rem 1.5rem;
} }
.note-list { .note-list {
@@ -65,10 +65,10 @@
.note-don-doff { .note-don-doff {
position: absolute; position: absolute;
left: -1rem; left: -1rem;
top: 0; top: -1rem;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 1.25rem; gap: 0.4rem;
z-index: 1; z-index: 1;
.btn { margin: 0; } .btn { margin: 0; }
@@ -80,7 +80,7 @@
flex-direction: row; flex-direction: row;
align-items: flex-start; align-items: flex-start;
gap: 0.75rem; gap: 0.75rem;
padding: 0.75rem; padding: 0.75rem 0.75rem 0.75rem 1.25rem;
background-color: rgba(var(--tooltip-bg), 0.75); background-color: rgba(var(--tooltip-bg), 0.75);
backdrop-filter: blur(6px); backdrop-filter: blur(6px);
border: 0.1rem solid rgba(var(--secUser), 0.4); border: 0.1rem solid rgba(var(--secUser), 0.4);

View File

@@ -6,7 +6,6 @@
{% block content %} {% block content %}
<div class="note-page"> <div class="note-page">
<h2>My Notes</h2>
<ul class="note-list"> <ul class="note-list">
{% for item in note_items %} {% for item in note_items %}
<li class="note-item" data-slug="{{ item.obj.slug }}" <li class="note-item" data-slug="{{ item.obj.slug }}"