penpot/frontend/test/frontend_tests/ui/settings_text_language_test.cljs
alonso.torres 597ed9dc94 ✨ Add the language profile and CJK options to the workspace
- The Text section shows writing mode, orientation and Distribute when
  the text has a CJK profile.
- A Language section picks the profile of the selected texts. Its
  options open in a view of their own, grouped in Selected text, Layout
  and Ruby.
- A compact menu at the selected text opens readings, emphasis marks and
  other options of the selection.
- File and Preferences menus and the account settings set the file and
  the default profiles. New texts take the last profile used, else the
  file one.

The board size presets share the new grouped dropdown. Add English,
Spanish and Japanese translations.

AI-assisted-by: claude-opus-5-5
2026-11-16 22:37:36 +01:00

27 lines
1.1 KiB
Clojure

;; This Source Code Form is subject to the terms of the Mozilla Public
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; Copyright (c) KALEIDOS SUBSIDIARY SL
(ns frontend-tests.ui.settings-text-language-test
(:require
["react-dom/server" :as rds]
[app.main.ui.hooks :as hooks]
[app.main.ui.settings.options :as options]
[cljs.test :as t :include-macros true]
[cuerdas.core :as str]
[rumext.v2 :as mf]))
(defn- render
[language]
(with-redefs [hooks/use-portal-container (fn ([] nil) ([_] nil))]
(rds/renderToStaticMarkup
(mf/element @#'options/text-language-settings* (mf/props {:language language})))))
(t/deftest profile-text-language-shows-the-chosen-language
(t/is (str/includes? (render nil) "dashboard.text-language.none"))
(t/is (str/includes? (render nil) "dashboard.text-language.label"))
(t/is (str/includes? (render "zh-Hant-TW") "workspace.options.text-options.language-chinese-taiwan"))
(t/is (str/includes? (render "ja") "workspace.options.text-options.language-japanese")))