fix: lint

This commit is contained in:
charlie
2026-05-22 14:29:36 +08:00
parent f5050e99e4
commit 810c697355
2 changed files with 10 additions and 11 deletions

View File

@@ -9,7 +9,6 @@
[frontend.dicts :as dicts]
[frontend.handler.ui :as ui-handler]
[frontend.handler.user :as user-handler]
[frontend.mobile.util :as mobile-util]
[frontend.state :as state]
[frontend.storage :as storage]
[frontend.ui :as ui]

View File

@@ -5,33 +5,33 @@
(deftest iphone-limits-main-tabs-to-four
(testing "iPhone keeps four configurable content tabs; native search is separate"
(is (= ["home" "graphs" "capture" "flashcards"]
(tabs/selected-tab-ids nil {:flashcards? true} (tabs/max-main-tabs true)))))
(tabs/selected-tab-ids nil {:flashcards? true} (tabs/max-main-tabs)))))
(testing "custom tab selections are respected before applying the iPhone cap"
(is (= ["home" "graphs" "go to" "capture"]
(tabs/selected-tab-ids ["home" "graphs" "go to" "capture" "flashcards"]
{:flashcards? true}
(tabs/max-main-tabs true))))))
(tabs/max-main-tabs))))))
(deftest selected-tabs-ignore-unavailable-tabs
(testing "disabled flashcards and unknown tab ids are removed"
(is (= ["home" "graphs" "go to"]
(tabs/selected-tab-ids ["unknown" "home" "flashcards" "graphs" "go to"]
{:flashcards? false}
(tabs/max-main-tabs false))))))
(tabs/max-main-tabs))))))
(deftest selected-tabs-always-include-home
(testing "home is kept as the stable first tab even when custom data omits it"
(is (= ["home" "graphs" "capture"]
(tabs/selected-tab-ids ["graphs" "capture"]
{:flashcards? true}
(tabs/max-main-tabs false)))))
(tabs/max-main-tabs)))))
(testing "home is moved back to the first position when custom data reorders it"
(is (= ["home" "graphs" "capture"]
(tabs/selected-tab-ids ["graphs" "home" "capture"]
{:flashcards? true}
(tabs/max-main-tabs false))))))
(tabs/max-main-tabs))))))
(deftest reorder-selected-tabs
(testing "dragging a selected tab before another selected tab changes tab order"
@@ -40,7 +40,7 @@
"flashcards"
"graphs"
{:flashcards? true}
(tabs/max-main-tabs true)))))
(tabs/max-main-tabs)))))
(testing "dragging a selected tab down inserts it after the target tab"
(is (= ["home" "capture" "flashcards" "graphs"]
@@ -48,7 +48,7 @@
"graphs"
"flashcards"
{:flashcards? true}
(tabs/max-main-tabs true)))))
(tabs/max-main-tabs)))))
(testing "dragging home is ignored because it is the stable first tab"
(is (= ["home" "graphs" "capture" "flashcards"]
@@ -56,7 +56,7 @@
"home"
"capture"
{:flashcards? true}
(tabs/max-main-tabs true)))))
(tabs/max-main-tabs)))))
(testing "dragging before home is ignored because home is pinned"
(is (= ["home" "graphs" "capture" "flashcards"]
@@ -64,7 +64,7 @@
"capture"
"home"
{:flashcards? true}
(tabs/max-main-tabs true)))))
(tabs/max-main-tabs)))))
(testing "reordering ignores unavailable targets"
(is (= ["home" "graphs" "capture"]
@@ -72,4 +72,4 @@
"capture"
"flashcards"
{:flashcards? false}
(tabs/max-main-tabs false))))))
(tabs/max-main-tabs))))))