diff --git a/tests/e2e/test_change_lang.py b/tests/e2e/test_change_lang.py deleted file mode 100644 index 05bbc2d3..00000000 --- a/tests/e2e/test_change_lang.py +++ /dev/null @@ -1,33 +0,0 @@ -from playwright.sync_api import Cookie, Page, expect - - -def test_change_language(browser: Page) -> Cookie | None: - # TODO: (Christopher) figure out what we want to do with - # pyright complaining about accessing dict values, which - # we ingnore now. - def get_lang_cookie(browser: Page): - for cookie in browser.context.cookies(): - if cookie["name"] == "lang": # type: ignore - return cookie - return None - - browser.goto("/pages/") - - # Upon opening make sure no cookie is set. - lang_cookie = get_lang_cookie(browser) - assert lang_cookie is None - - browser.click("#langselect-nl") - expect(browser.locator("#langselect-nl.selected")).to_be_visible() - lang_cookie = get_lang_cookie(browser) - assert lang_cookie["value"] == "nl" # type: ignore - - browser.click("#langselect-fy") - expect(browser.locator("#langselect-fy.selected")).to_be_visible() - lang_cookie = get_lang_cookie(browser) - assert lang_cookie["value"] == "fy" # type: ignore - - browser.click("#langselect-en") - expect(browser.locator("#langselect-en.selected")).to_be_visible() - lang_cookie = get_lang_cookie(browser) - assert lang_cookie["value"] == "en" # type: ignore diff --git a/tests/e2e/test_move_task.py b/tests/e2e/test_move_task.py index e796b76b..c9e38d2e 100644 --- a/tests/e2e/test_move_task.py +++ b/tests/e2e/test_move_task.py @@ -1,9 +1,41 @@ -from playwright.sync_api import Page, expect +from playwright.sync_api import Cookie, Page, expect from tests.constants import all_statusses, default_task from tests.database_test_utils import DatabaseTestUtils +def test_change_language(browser: Page) -> Cookie | None: + # TODO: (Christopher) figure out what we want to do with + # pyright complaining about accessing dict values, which + # we ingnore now. + def get_lang_cookie(browser: Page): + for cookie in browser.context.cookies(): + if cookie["name"] == "lang": # type: ignore + return cookie + return None + + browser.goto("/pages/") + + # Upon opening make sure no cookie is set. + lang_cookie = get_lang_cookie(browser) + assert lang_cookie is None + + browser.click("#langselect-nl") + expect(browser.locator("#langselect-nl.selected")).to_be_visible() + lang_cookie = get_lang_cookie(browser) + assert lang_cookie["value"] == "nl" # type: ignore + + browser.click("#langselect-fy") + expect(browser.locator("#langselect-fy.selected")).to_be_visible() + lang_cookie = get_lang_cookie(browser) + assert lang_cookie["value"] == "fy" # type: ignore + + browser.click("#langselect-en") + expect(browser.locator("#langselect-en.selected")).to_be_visible() + lang_cookie = get_lang_cookie(browser) + assert lang_cookie["value"] == "en" # type: ignore + + def test_move_task_to_column(browser: Page, db: DatabaseTestUtils) -> None: """ Test moving a task in the browser to another column and verify that after a reload