fix FT note→post renames in test_sharing & test_layout_and_styling; note page layout polish
- 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:
@@ -1,12 +1,12 @@
|
||||
from .base import FunctionalTest
|
||||
from .note_page import NotePage
|
||||
from .post_page import PostPage
|
||||
|
||||
|
||||
class LayoutAndStylingTest(FunctionalTest):
|
||||
def test_layout_and_styling(self):
|
||||
self.create_pre_authenticated_session("disco@test.io")
|
||||
self.browser.get(self.live_server_url)
|
||||
note_page = NotePage(self)
|
||||
self.browser.get(self.live_server_url + '/billboard/')
|
||||
post_page = PostPage(self)
|
||||
|
||||
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];
|
||||
""", el)
|
||||
|
||||
inputbox = note_page.get_item_input_box()
|
||||
inputbox = post_page.get_line_input_box()
|
||||
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()
|
||||
post_page.add_post_line("testing")
|
||||
inputbox = post_page.get_line_input_box()
|
||||
input_c, section_c = section_center(inputbox)
|
||||
self.assertAlmostEqual(input_c, section_c, delta=10)
|
||||
|
||||
@@ -6,8 +6,8 @@ from selenium import webdriver
|
||||
from selenium.webdriver.common.by import By
|
||||
|
||||
from .base import FunctionalTest
|
||||
from .note_page import NotePage
|
||||
from .my_notes_page import MyNotesPage
|
||||
from .post_page import PostPage
|
||||
from .my_posts_page import MyPostsPage
|
||||
|
||||
|
||||
# Helper fns
|
||||
@@ -21,7 +21,7 @@ def quit_if_possible(browser):
|
||||
# Test mdls
|
||||
class SharingTest(FunctionalTest):
|
||||
@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")
|
||||
disco_browser = self.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.browser = disco_browser
|
||||
self.browser.get(self.live_server_url)
|
||||
note_page = NotePage(self).add_note_item("Send help")
|
||||
self.browser.get(self.live_server_url + '/billboard/')
|
||||
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(
|
||||
share_box.get_attribute("placeholder"),
|
||||
"friend@example.com",
|
||||
)
|
||||
|
||||
note_page.share_note_with("alice@test.io")
|
||||
post_page.share_post_with("alice@test.io")
|
||||
|
||||
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.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.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):
|
||||
def test_stranger_cannot_access_owned_note(self):
|
||||
class PostAccessTest(FunctionalTest):
|
||||
def test_stranger_cannot_access_owned_post(self):
|
||||
self.create_pre_authenticated_session("disco@test.io")
|
||||
self.browser.get(self.live_server_url)
|
||||
note_page = NotePage(self).add_note_item("private eye")
|
||||
note_url = self.browser.current_url
|
||||
self.browser.get(self.live_server_url + '/billboard/')
|
||||
PostPage(self).add_post_line("private eye")
|
||||
post_url = self.browser.current_url
|
||||
|
||||
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)
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
// ── Notes page ─────────────────────────────────────────────────────────────
|
||||
|
||||
.note-page {
|
||||
padding: 0.75rem;
|
||||
padding: 0.75rem 1.5rem;
|
||||
}
|
||||
|
||||
.note-list {
|
||||
@@ -65,10 +65,10 @@
|
||||
.note-don-doff {
|
||||
position: absolute;
|
||||
left: -1rem;
|
||||
top: 0;
|
||||
top: -1rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1.25rem;
|
||||
gap: 0.4rem;
|
||||
z-index: 1;
|
||||
|
||||
.btn { margin: 0; }
|
||||
@@ -80,7 +80,7 @@
|
||||
flex-direction: row;
|
||||
align-items: flex-start;
|
||||
gap: 0.75rem;
|
||||
padding: 0.75rem;
|
||||
padding: 0.75rem 0.75rem 0.75rem 1.25rem;
|
||||
background-color: rgba(var(--tooltip-bg), 0.75);
|
||||
backdrop-filter: blur(6px);
|
||||
border: 0.1rem solid rgba(var(--secUser), 0.4);
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
{% block content %}
|
||||
<div class="note-page">
|
||||
<h2>My Notes</h2>
|
||||
<ul class="note-list">
|
||||
{% for item in note_items %}
|
||||
<li class="note-item" data-slug="{{ item.obj.slug }}"
|
||||
|
||||
Reference in New Issue
Block a user