mirror of
https://github.com/penpot/penpot.git
synced 2026-09-08 13:09:22 +00:00
🐛 Fix some integration tests
This commit is contained in:
parent
3fe06e0b5a
commit
b433b52be7
@ -25,7 +25,7 @@
|
|||||||
"~:revn": 11,
|
"~:revn": 11,
|
||||||
"~:modified-at": "~m1778577544627",
|
"~:modified-at": "~m1778577544627",
|
||||||
"~:vern": 151920609,
|
"~:vern": 151920609,
|
||||||
"~:id": "~u1bac06a1-a942-80a6-8008-0222e1ec38d5",
|
"~:id": "~uc7ce0794-0992-8105-8004-38f280443849",
|
||||||
"~:is-shared": false,
|
"~:is-shared": false,
|
||||||
"~:migrations": {
|
"~:migrations": {
|
||||||
"~#ordered-set": [
|
"~#ordered-set": [
|
||||||
@ -128,6 +128,23 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"~:tokens-status": {
|
||||||
|
"~#penpot/tokens-status": {
|
||||||
|
"~:active-theme-ids": {
|
||||||
|
"~#set": ["~uc00d9d2e-76f9-815b-8005-e1260332abac", "~uc00d9d2e-76f9-815b-8005-e1260332abb0"]
|
||||||
|
},
|
||||||
|
"~:active-set-ids": {
|
||||||
|
"~#set": [
|
||||||
|
"~u4cdd76d8-0e6d-8168-8008-01189f0ece1d",
|
||||||
|
"~u4cdd76d8-0e6d-8168-8008-01189f161e35",
|
||||||
|
"~u4cdd76d8-0e6d-8168-8008-01189f101a3f",
|
||||||
|
"~u4cdd76d8-0e6d-8168-8008-01189f0e2151",
|
||||||
|
"~u4cdd76d8-0e6d-8168-8008-01189f0cf6d3",
|
||||||
|
"~u4cdd76d8-0e6d-8168-8008-01189f0e7da8"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"~:tokens-lib": {
|
"~:tokens-lib": {
|
||||||
"~#penpot/tokens-lib": {
|
"~#penpot/tokens-lib": {
|
||||||
"~:sets": {
|
"~:sets": {
|
||||||
@ -4312,7 +4329,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"~:id": "~u1bac06a1-a942-80a6-8008-0222e1ec38d5",
|
"~:id": "~uc7ce0794-0992-8105-8004-38f280443849",
|
||||||
"~:options": {
|
"~:options": {
|
||||||
"~:components-v2": true,
|
"~:components-v2": true,
|
||||||
"~:base-font-size": "16px"
|
"~:base-font-size": "16px"
|
||||||
|
|||||||
@ -5771,6 +5771,16 @@
|
|||||||
},
|
},
|
||||||
"~:id": "~u7b2da435-6186-815a-8007-0daa95d2f26d",
|
"~:id": "~u7b2da435-6186-815a-8007-0daa95d2f26d",
|
||||||
"~:options": { "~:components-v2": true, "~:base-font-size": "16px" },
|
"~:options": { "~:components-v2": true, "~:base-font-size": "16px" },
|
||||||
|
"~:tokens-status": {
|
||||||
|
"~#penpot/tokens-status": {
|
||||||
|
"~:active-theme-ids": {
|
||||||
|
"~#set": []
|
||||||
|
},
|
||||||
|
"~:active-set-ids": {
|
||||||
|
"~#set": ["~u5403f14e-eb02-80be-8007-0494f09cefca"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"~:tokens-lib": {
|
"~:tokens-lib": {
|
||||||
"~#penpot/tokens-lib": {
|
"~#penpot/tokens-lib": {
|
||||||
"~:sets": {
|
"~:sets": {
|
||||||
|
|||||||
@ -29,7 +29,7 @@
|
|||||||
"~:revn": 36,
|
"~:revn": 36,
|
||||||
"~:modified-at": "~m1776760054954",
|
"~:modified-at": "~m1776760054954",
|
||||||
"~:vern": 0,
|
"~:vern": 0,
|
||||||
"~:id": "~u1062e0a0-8fe0-80ae-8007-e70b4993f5ef",
|
"~:id": "~uc7ce0794-0992-8105-8004-38f280443849",
|
||||||
"~:is-shared": false,
|
"~:is-shared": false,
|
||||||
"~:migrations": {
|
"~:migrations": {
|
||||||
"~#ordered-set": [
|
"~#ordered-set": [
|
||||||
@ -423,7 +423,7 @@
|
|||||||
"~:key": "wgjr6b27pa",
|
"~:key": "wgjr6b27pa",
|
||||||
"~:font-size": "16",
|
"~:font-size": "16",
|
||||||
"~:font-weight": "400",
|
"~:font-weight": "400",
|
||||||
"~:typography-ref-file": "~u1062e0a0-8fe0-80ae-8007-e70b4993f5ef",
|
"~:typography-ref-file": "~uc7ce0794-0992-8105-8004-38f280443849",
|
||||||
"~:modified-at": "~m1776759448186",
|
"~:modified-at": "~m1776759448186",
|
||||||
"~:font-variant-id": "regular",
|
"~:font-variant-id": "regular",
|
||||||
"~:text-decoration": "none",
|
"~:text-decoration": "none",
|
||||||
@ -445,7 +445,7 @@
|
|||||||
"~:key": "1dpjnycmsmq",
|
"~:key": "1dpjnycmsmq",
|
||||||
"~:font-size": "16",
|
"~:font-size": "16",
|
||||||
"~:font-weight": "400",
|
"~:font-weight": "400",
|
||||||
"~:typography-ref-file": "~u1062e0a0-8fe0-80ae-8007-e70b4993f5ef",
|
"~:typography-ref-file": "~uc7ce0794-0992-8105-8004-38f280443849",
|
||||||
"~:text-direction": "ltr",
|
"~:text-direction": "ltr",
|
||||||
"~:type": "paragraph",
|
"~:type": "paragraph",
|
||||||
"~:modified-at": "~m1776759448186",
|
"~:modified-at": "~m1776759448186",
|
||||||
@ -1079,7 +1079,7 @@
|
|||||||
"~:key": "wgjr6b27pa",
|
"~:key": "wgjr6b27pa",
|
||||||
"~:font-size": "18",
|
"~:font-size": "18",
|
||||||
"~:font-weight": "700",
|
"~:font-weight": "700",
|
||||||
"~:typography-ref-file": "~u1062e0a0-8fe0-80ae-8007-e70b4993f5ef",
|
"~:typography-ref-file": "~uc7ce0794-0992-8105-8004-38f280443849",
|
||||||
"~:modified-at": "~m1776759420985",
|
"~:modified-at": "~m1776759420985",
|
||||||
"~:font-variant-id": "700",
|
"~:font-variant-id": "700",
|
||||||
"~:text-decoration": "none",
|
"~:text-decoration": "none",
|
||||||
@ -1101,7 +1101,7 @@
|
|||||||
"~:key": "1dpjnycmsmq",
|
"~:key": "1dpjnycmsmq",
|
||||||
"~:font-size": "18",
|
"~:font-size": "18",
|
||||||
"~:font-weight": "700",
|
"~:font-weight": "700",
|
||||||
"~:typography-ref-file": "~u1062e0a0-8fe0-80ae-8007-e70b4993f5ef",
|
"~:typography-ref-file": "~uc7ce0794-0992-8105-8004-38f280443849",
|
||||||
"~:text-direction": "ltr",
|
"~:text-direction": "ltr",
|
||||||
"~:type": "paragraph",
|
"~:type": "paragraph",
|
||||||
"~:modified-at": "~m1776759420985",
|
"~:modified-at": "~m1776759420985",
|
||||||
@ -1517,7 +1517,7 @@
|
|||||||
"~:name": "Page 1"
|
"~:name": "Page 1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"~:id": "~u1062e0a0-8fe0-80ae-8007-e70b4993f5ef",
|
"~:id": "~uc7ce0794-0992-8105-8004-38f280443849",
|
||||||
"~:options": {
|
"~:options": {
|
||||||
"~:components-v2": true,
|
"~:components-v2": true,
|
||||||
"~:base-font-size": "16px"
|
"~:base-font-size": "16px"
|
||||||
@ -1554,6 +1554,18 @@
|
|||||||
"~:font-family": "IM Fell French Canon SC"
|
"~:font-family": "IM Fell French Canon SC"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"~:tokens-status": {
|
||||||
|
"~#penpot/tokens-status": {
|
||||||
|
"~:active-theme-ids": {
|
||||||
|
"~#set": []
|
||||||
|
},
|
||||||
|
"~:active-set-ids": {
|
||||||
|
"~#set": [
|
||||||
|
"~u12f7a4ff-ddae-80ff-8007-e70bba7e2db2"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"~:tokens-lib": {
|
"~:tokens-lib": {
|
||||||
"~#penpot/tokens-lib": {
|
"~#penpot/tokens-lib": {
|
||||||
"~:sets": {
|
"~:sets": {
|
||||||
|
|||||||
@ -31,6 +31,7 @@ test("User adds a library and its automatically selected in the color palette",
|
|||||||
// Now the get-file call should return a library
|
// Now the get-file call should return a library
|
||||||
await workspacePage.mockRPC(/get\-file\?/, "workspace/get-file-library.json");
|
await workspacePage.mockRPC(/get\-file\?/, "workspace/get-file-library.json");
|
||||||
await workspacePage.openLibrariesModal();
|
await workspacePage.openLibrariesModal();
|
||||||
|
await workspacePage.librariesModal.getByRole("tab", { name: "Libraries" }).click();
|
||||||
await workspacePage.clickLibrary("Testing library 1");
|
await workspacePage.clickLibrary("Testing library 1");
|
||||||
await workspacePage.closeLibrariesModal();
|
await workspacePage.closeLibrariesModal();
|
||||||
|
|
||||||
@ -40,6 +41,7 @@ test("User adds a library and its automatically selected in the color palette",
|
|||||||
|
|
||||||
// Remove Testing library 1
|
// Remove Testing library 1
|
||||||
await workspacePage.openLibrariesModal();
|
await workspacePage.openLibrariesModal();
|
||||||
|
await workspacePage.librariesModal.getByRole("tab", { name: "This file" }).click();
|
||||||
await workspacePage.clickLibrary("Testing library 1");
|
await workspacePage.clickLibrary("Testing library 1");
|
||||||
await workspacePage.closeLibrariesModal();
|
await workspacePage.closeLibrariesModal();
|
||||||
|
|
||||||
|
|||||||
@ -152,6 +152,7 @@ test("[Taiga #10630] [INSPECT] Style assets not being displayed on info tab", as
|
|||||||
await workspacePage.clickAssets();
|
await workspacePage.clickAssets();
|
||||||
await workspacePage.mockRPC(/get\-file\?/, "workspace/get-file-library.json");
|
await workspacePage.mockRPC(/get\-file\?/, "workspace/get-file-library.json");
|
||||||
await workspacePage.openLibrariesModal();
|
await workspacePage.openLibrariesModal();
|
||||||
|
await workspacePage.librariesModal.getByRole("tab", { name: "Libraries" }).click();
|
||||||
await workspacePage.clickLibrary("Testing library 1");
|
await workspacePage.clickLibrary("Testing library 1");
|
||||||
await workspacePage.closeLibrariesModal();
|
await workspacePage.closeLibrariesModal();
|
||||||
|
|
||||||
|
|||||||
@ -210,7 +210,7 @@ test("Multiselection of text and typographies", async ({ page }) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
await workspacePage.goToWorkspace({
|
await workspacePage.goToWorkspace({
|
||||||
fileId: "1062e0a0-8fe0-80ae-8007-e70b4993f5ef",
|
fileId: "c7ce0794-0992-8105-8004-38f280443849",
|
||||||
pageId: "1062e0a0-8fe0-80ae-8007-e70b4993f5f0",
|
pageId: "1062e0a0-8fe0-80ae-8007-e70b4993f5f0",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -89,6 +89,12 @@ test.describe("Tokens Themes", () => {
|
|||||||
tokenThemeUpdateCreateModal.getByText("Changed" + "4 active sets"),
|
tokenThemeUpdateCreateModal.getByText("Changed" + "4 active sets"),
|
||||||
).toBeVisible();
|
).toBeVisible();
|
||||||
|
|
||||||
|
await tokenThemeUpdateCreateModal
|
||||||
|
.getByRole("switch", {
|
||||||
|
name: "Changed",
|
||||||
|
})
|
||||||
|
.click();
|
||||||
|
|
||||||
await tokenThemeUpdateCreateModal
|
await tokenThemeUpdateCreateModal
|
||||||
.getByRole("button")
|
.getByRole("button")
|
||||||
.getByText("close")
|
.getByText("close")
|
||||||
|
|||||||
@ -143,6 +143,10 @@ test("BUG 14214 - Updates tab refreshes after syncing a freshly linked library",
|
|||||||
// Open the library modal
|
// Open the library modal
|
||||||
await workspace.clickAssets();
|
await workspace.clickAssets();
|
||||||
await workspace.openLibrariesModal();
|
await workspace.openLibrariesModal();
|
||||||
|
|
||||||
|
// Switch to the Libraries tab
|
||||||
|
await workspace.librariesModal.getByRole("tab", { name: "Libraries" }).click();
|
||||||
|
|
||||||
await workspace.librariesModal
|
await workspace.librariesModal
|
||||||
.getByRole("button", { name: "Connect library" })
|
.getByRole("button", { name: "Connect library" })
|
||||||
.click();
|
.click();
|
||||||
|
|||||||
@ -25,7 +25,7 @@ import { WasmWorkspacePage } from "../pages/WasmWorkspacePage";
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
const FILE_A = {
|
const FILE_A = {
|
||||||
id: "1062e0a0-8fe0-80ae-8007-e70b4993f5ef",
|
id: "c7ce0794-0992-8105-8004-38f280443849",
|
||||||
pageId: "1062e0a0-8fe0-80ae-8007-e70b4993f5f0",
|
pageId: "1062e0a0-8fe0-80ae-8007-e70b4993f5f0",
|
||||||
// "Text with typography asset one" carries a ref to in-file typography whose
|
// "Text with typography asset one" carries a ref to in-file typography whose
|
||||||
// font-family is "IM Fell French Canon SC" (multiselection-typography.json).
|
// font-family is "IM Fell French Canon SC" (multiselection-typography.json).
|
||||||
|
|||||||
@ -315,6 +315,7 @@ test("User adds a library and its automatically selected in the color palette",
|
|||||||
// Now the get-file call should return a library
|
// Now the get-file call should return a library
|
||||||
await workspacePage.mockRPC(/get\-file\?/, "workspace/get-file-library.json");
|
await workspacePage.mockRPC(/get\-file\?/, "workspace/get-file-library.json");
|
||||||
await workspacePage.openLibrariesModal();
|
await workspacePage.openLibrariesModal();
|
||||||
|
await workspacePage.librariesModal.getByRole("tab", { name: "Libraries" }).click();
|
||||||
await workspacePage.clickLibrary("Testing library 1");
|
await workspacePage.clickLibrary("Testing library 1");
|
||||||
await workspacePage.closeLibrariesModal();
|
await workspacePage.closeLibrariesModal();
|
||||||
|
|
||||||
|
|||||||
@ -9,6 +9,7 @@
|
|||||||
[app.common.data.macros :as dm]
|
[app.common.data.macros :as dm]
|
||||||
[app.common.files.changes-builder :as pcb]
|
[app.common.files.changes-builder :as pcb]
|
||||||
[app.common.files.helpers :as cfh]
|
[app.common.files.helpers :as cfh]
|
||||||
|
[app.common.files.tokens :as cfo]
|
||||||
[app.common.geom.point :as gpt]
|
[app.common.geom.point :as gpt]
|
||||||
[app.common.logic.tokens :as clo]
|
[app.common.logic.tokens :as clo]
|
||||||
[app.common.path-names :as cpn]
|
[app.common.path-names :as cpn]
|
||||||
@ -415,9 +416,11 @@
|
|||||||
ptk/WatchEvent
|
ptk/WatchEvent
|
||||||
(watch [it state _]
|
(watch [it state _]
|
||||||
(let [data (dsh/lookup-file-data state)
|
(let [data (dsh/lookup-file-data state)
|
||||||
|
status (cfo/make-tokens-status-from-lib lib)
|
||||||
changes (-> (pcb/empty-changes it)
|
changes (-> (pcb/empty-changes it)
|
||||||
(pcb/with-library-data data)
|
(pcb/with-library-data data)
|
||||||
(pcb/set-tokens-lib lib))]
|
(pcb/set-tokens-lib lib)
|
||||||
|
(pcb/set-tokens-status status))]
|
||||||
(rx/of (dch/commit-changes changes)
|
(rx/of (dch/commit-changes changes)
|
||||||
(dwtp/propagate-workspace-tokens))))))
|
(dwtp/propagate-workspace-tokens))))))
|
||||||
|
|
||||||
|
|||||||
@ -506,7 +506,7 @@
|
|||||||
(def workspace-token-sets-tree
|
(def workspace-token-sets-tree
|
||||||
(l/derived (d/nilf ctob/get-set-tree) tokens-lib))
|
(l/derived (d/nilf ctob/get-set-tree) tokens-lib))
|
||||||
|
|
||||||
(def workspace-active-theme-paths
|
(def workspace-active-theme-ids
|
||||||
(l/derived (d/nilf ctos/get-active-theme-ids) tokens-status))
|
(l/derived (d/nilf ctos/get-active-theme-ids) tokens-status))
|
||||||
|
|
||||||
(def workspace-all-tokens-map
|
(def workspace-all-tokens-map
|
||||||
@ -521,9 +521,6 @@
|
|||||||
(cfo/sets-at-path-all-active? status @(l/derived identity tokens-lib) group-path)))
|
(cfo/sets-at-path-all-active? status @(l/derived identity tokens-lib) group-path)))
|
||||||
tokens-status))
|
tokens-status))
|
||||||
|
|
||||||
(def workspace-active-theme-paths-no-hidden
|
|
||||||
workspace-active-theme-paths)
|
|
||||||
|
|
||||||
;; FIXME: deprecated, it should not be implemented with ref (still used in form)
|
;; FIXME: deprecated, it should not be implemented with ref (still used in form)
|
||||||
(def workspace-active-theme-sets-tokens
|
(def workspace-active-theme-sets-tokens
|
||||||
(l/derived (fn [[status lib]]
|
(l/derived (fn [[status lib]]
|
||||||
|
|||||||
@ -113,7 +113,7 @@
|
|||||||
|
|
||||||
tokens-lib (mf/deref refs/tokens-lib)
|
tokens-lib (mf/deref refs/tokens-lib)
|
||||||
tokens-status (mf/deref refs/tokens-status)
|
tokens-status (mf/deref refs/tokens-status)
|
||||||
active-themes (mf/deref refs/workspace-active-theme-paths)
|
active-themes (mf/deref refs/workspace-active-theme-ids)
|
||||||
active-sets (mf/with-memo [tokens-status tokens-lib]
|
active-sets (mf/with-memo [tokens-status tokens-lib]
|
||||||
(when (and tokens-status tokens-lib)
|
(when (and tokens-status tokens-lib)
|
||||||
(cfo/get-active-sets tokens-status tokens-lib)))
|
(cfo/get-active-sets tokens-status tokens-lib)))
|
||||||
|
|||||||
@ -67,7 +67,7 @@
|
|||||||
|
|
||||||
(mf/defc themes-overview
|
(mf/defc themes-overview
|
||||||
[{:keys [change-view]}]
|
[{:keys [change-view]}]
|
||||||
(let [active-theme-paths (mf/deref refs/workspace-active-theme-paths)
|
(let [active-theme-ids (mf/deref refs/workspace-active-theme-ids)
|
||||||
themes-groups (mf/deref refs/workspace-token-theme-tree-no-hidden)
|
themes-groups (mf/deref refs/workspace-token-theme-tree-no-hidden)
|
||||||
|
|
||||||
create-theme
|
create-theme
|
||||||
@ -96,7 +96,7 @@
|
|||||||
[:ul {:class (stl/css :theme-group-rows-wrapper)}
|
[:ul {:class (stl/css :theme-group-rows-wrapper)}
|
||||||
(for [[_ {:keys [id name] :as theme}] themes
|
(for [[_ {:keys [id name] :as theme}] themes
|
||||||
:let [theme-path (ctob/get-theme-path theme)
|
:let [theme-path (ctob/get-theme-path theme)
|
||||||
selected? (some? (get active-theme-paths theme-path))
|
selected? (some? (get active-theme-ids (ctob/get-id theme)))
|
||||||
delete-theme
|
delete-theme
|
||||||
(fn [e]
|
(fn [e]
|
||||||
(dom/prevent-default e)
|
(dom/prevent-default e)
|
||||||
@ -325,9 +325,10 @@
|
|||||||
|
|
||||||
on-toggle-token-set
|
on-toggle-token-set
|
||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
(mf/deps current-theme)
|
(mf/deps current-theme tokens-lib)
|
||||||
(fn [set-name]
|
(fn [set-id]
|
||||||
(swap! current-theme* #(ctob/toggle-set % set-name))))
|
(let [set (ctob/get-set tokens-lib set-id)]
|
||||||
|
(swap! current-theme* #(ctob/toggle-set % (ctob/get-name set))))))
|
||||||
|
|
||||||
on-toggle-token-set-group
|
on-toggle-token-set-group
|
||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
|
|||||||
@ -674,7 +674,7 @@
|
|||||||
;; requested. Enabling only adds the set name to the hidden theme,
|
;; requested. Enabling only adds the set name to the hidden theme,
|
||||||
;; so it does not depend on the create event having propagated yet.
|
;; so it does not depend on the create event having propagated yet.
|
||||||
(when active?
|
(when active?
|
||||||
(st/emit! (dwtl/set-enabled-token-set (ctob/get-name set) true)))
|
(st/emit! (dwtl/set-enabled-token-set (ctob/get-id set) true)))
|
||||||
;; Pass the set name as `initial-name` so the proxy can resolve
|
;; Pass the set name as `initial-name` so the proxy can resolve
|
||||||
;; it immediately, before the async `st/emit!` above propagates
|
;; it immediately, before the async `st/emit!` above propagates
|
||||||
;; the new set into `@st/state`.
|
;; the new set into `@st/state`.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user