renamed List to Note everywhere thru-out project in preparation for complete overhaul of applet capabilities

This commit is contained in:
Disco DeDisco
2026-03-11 13:59:43 -04:00
parent aa1cef6e7b
commit f45740d8b3
29 changed files with 435 additions and 394 deletions

View File

@@ -5,8 +5,8 @@ from selenium import webdriver
from selenium.webdriver.common.by import By
from .base import FunctionalTest
from .list_page import ListPage
from .my_lists_page import MyListsPage
from .note_page import NotePage
from .my_notes_page import MyNotesPage
# Helper fns
@@ -19,7 +19,7 @@ def quit_if_possible(browser):
# Test mdls
class SharingTest(FunctionalTest):
def test_can_share_a_list_with_another_user(self):
def test_can_share_a_note_with_another_user(self):
self.create_pre_authenticated_session("disco@test.io")
disco_browser = self.browser
self.addCleanup(lambda: quit_if_possible(disco_browser))
@@ -34,40 +34,39 @@ class SharingTest(FunctionalTest):
self.browser = disco_browser
self.browser.get(self.live_server_url)
list_page = ListPage(self).add_list_item("Send help")
note_page = NotePage(self).add_note_item("Send help")
share_box = list_page.get_share_box()
share_box = note_page.get_share_box()
self.assertEqual(
share_box.get_attribute("placeholder"),
"friend@example.com",
)
list_page.share_list_with("alice@test.io")
note_page.share_note_with("alice@test.io")
self.browser = ali_browser
MyListsPage(self).go_to_my_lists_page("alice@test.io")
MyNotesPage(self).go_to_my_notes_page("alice@test.io")
self.browser.find_element(By.LINK_TEXT, "Send help").click()
self.wait_for(
lambda: self.assertEqual(list_page.get_list_owner(), "disco@test.io")
lambda: self.assertEqual(note_page.get_note_owner(), "disco@test.io")
)
list_page.add_list_item("At your command, Disco King")
note_page.add_note_item("At your command, Disco King")
self.browser = disco_browser
self.browser.refresh()
list_page.wait_for_row_in_list_table("At your command, Disco King", 2)
note_page.wait_for_row_in_note_table("At your command, Disco King", 2)
class ListAccessTest(FunctionalTest):
def test_stranger_cannot_access_owned_list(self):
class NoteAccessTest(FunctionalTest):
def test_stranger_cannot_access_owned_note(self):
self.create_pre_authenticated_session("disco@test.io")
self.browser.get(self.live_server_url)
list_page = ListPage(self).add_list_item("private eye")
list_url = self.browser.current_url
note_page = NotePage(self).add_note_item("private eye")
note_url = self.browser.current_url
self.browser.delete_cookie(settings.SESSION_COOKIE_NAME)
self.browser.get(list_url)
self.assertNotEqual(self.browser.current_url, list_url)
self.browser.get(note_url)
self.assertNotEqual(self.browser.current_url, note_url)