mirror of
https://github.com/penpot/penpot.git
synced 2026-11-17 07:30:35 +00:00
* ✨ Disable the admin-console by default in the devenv frontend The devenv does not run the admin-console service, but the frontend showed its UI by default. The devenv containers now build the frontend with PENPOT_DEVENV=true, which prepends disable-admin-console ahead of the developer's config.js flags. Flags parse in order, so enable-admin-console in config.js re-enables it; builds outside devenv are unchanged. Closes #13060 AI-assisted-by: inkling-2-small-free * 📚 Require English in all code-facing text Add a hard rule to AGENTS.md: everything in code must be in English — identifiers, comments, docstrings, test descriptions, log hints — with tests not excepted. The only allowed place for another language is product copy rendered through the i18n system. Also restated in mem:clojure/design-rules and mem:testing. AI-assisted-by: inkling-2-small-free
28 lines
1.3 KiB
Clojure
28 lines
1.3 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.config-test
|
|
(:require
|
|
[app.common.flags :as flags]
|
|
[app.config :as cf]
|
|
[cljs.test :as t :include-macros true]))
|
|
|
|
(def ^:private apply-devenv-defaults @#'cf/apply-devenv-defaults)
|
|
|
|
(t/deftest devenv-default-disables-admin-console
|
|
(t/testing "in devenv, without user flags, the admin-console is disabled by default"
|
|
(t/is (not (contains? (flags/parse flags/default (apply-devenv-defaults true []))
|
|
:admin-console))))
|
|
(t/testing "in devenv, the user can re-enable it with enable-admin-console"
|
|
(t/is (contains? (flags/parse flags/default (apply-devenv-defaults true [:enable-admin-console]))
|
|
:admin-console)))
|
|
(t/testing "in devenv, the user's disable-admin-console is idempotent"
|
|
(t/is (not (contains? (flags/parse flags/default (apply-devenv-defaults true [:disable-admin-console]))
|
|
:admin-console))))
|
|
(t/testing "outside devenv, no default is injected and the flags defaults apply"
|
|
(t/is (contains? (flags/parse flags/default (apply-devenv-defaults false []))
|
|
:admin-console))))
|