From 44e1768fd45df0d3d966a1160e065fc86453a17e Mon Sep 17 00:00:00 2001 From: Sudo-Ivan Date: Fri, 6 Mar 2026 01:11:40 -0600 Subject: [PATCH] Refactor IdentitiesPage component for improved readability and functionality - Simplified the structure of the skeleton loading elements for better clarity. - Enhanced the import/export button click handling for improved readability. - Updated test case descriptions to reflect the functionality of showing import and export options when identities exist. --- .../components/settings/IdentitiesPage.vue | 27 +++++++++++++------ tests/frontend/IdentitiesPage.test.js | 5 ++-- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/meshchatx/src/frontend/components/settings/IdentitiesPage.vue b/meshchatx/src/frontend/components/settings/IdentitiesPage.vue index 3915faf..b18f08e 100644 --- a/meshchatx/src/frontend/components/settings/IdentitiesPage.vue +++ b/meshchatx/src/frontend/components/settings/IdentitiesPage.vue @@ -58,9 +58,7 @@ :key="'skel-' + i" class="glass-card overflow-hidden p-5 flex items-center gap-4" > -
+
@@ -68,8 +66,8 @@
{{ $t("identities.upload_key_file") }} @@ -313,10 +314,16 @@ class="input-field font-mono text-xs w-full" :placeholder="$t('identities.paste_base32_placeholder')" /> -
+
{{ identityRestoreError }}
-
+
{{ identityRestoreMessage }}
diff --git a/tests/frontend/IdentitiesPage.test.js b/tests/frontend/IdentitiesPage.test.js index 61a447c..0ba9172 100644 --- a/tests/frontend/IdentitiesPage.test.js +++ b/tests/frontend/IdentitiesPage.test.js @@ -110,13 +110,14 @@ describe("IdentitiesPage.vue", () => { expect(current.message_count).toBe(42); }); - it("shows export/import key section when current identity exists", async () => { + it("shows Import and Export all when identities exist", async () => { const wrapper = mountPage(); await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick(); expect(wrapper.vm.currentIdentity).toBeTruthy(); - expect(wrapper.text()).toContain("identities.key_control"); + expect(wrapper.text()).toContain("identities.import"); + expect(wrapper.text()).toContain("identities.export_all"); }); it("opens create modal and creates identity", async () => {