From 93bf7287cac7d1457ed57febda449897b20ebc01 Mon Sep 17 00:00:00 2001 From: Kazuya Takei Date: Wed, 15 May 2024 02:08:11 +0900 Subject: [PATCH] feat: Root page refers language registered from cookie Refs: #1 --- src/atsphinx/mini18n/templates/mini18n/index.html | 8 +++++++- tests/test_javascript.py | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/atsphinx/mini18n/templates/mini18n/index.html b/src/atsphinx/mini18n/templates/mini18n/index.html index 98a269b..b031ac2 100644 --- a/src/atsphinx/mini18n/templates/mini18n/index.html +++ b/src/atsphinx/mini18n/templates/mini18n/index.html @@ -10,12 +10,18 @@ diff --git a/tests/test_javascript.py b/tests/test_javascript.py index 7d231f1..624ffc9 100644 --- a/tests/test_javascript.py +++ b/tests/test_javascript.py @@ -78,3 +78,6 @@ def test__select_language(app: SphinxTestApp, page: Page): cookies = page.context.cookies() assert cookies[0]["name"] == "lang" assert cookies[0]["value"] == "ja" + page.goto(url) + time.sleep(0.5) + assert page.url.endswith("/ja/")