From dcc21acd077e44532a39c4d57e29463da3385d2e Mon Sep 17 00:00:00 2001
From: Linus Rath <139418639+rathlinus@users.noreply.github.com>
Date: Thu, 29 Oct 2026 16:17:16 +0100
Subject: [PATCH] fix: name the security settings fields and let a settings
row's label name its field
---
.../__tests__/form-labels-security.test.tsx | 28 ++++++++
.../settings/account-security-settings.tsx | 64 +++++++++++--------
components/settings/settings-section.tsx | 22 ++++++-
3 files changed, 88 insertions(+), 26 deletions(-)
create mode 100644 components/__tests__/form-labels-security.test.tsx
diff --git a/components/__tests__/form-labels-security.test.tsx b/components/__tests__/form-labels-security.test.tsx
new file mode 100644
index 000000000..1ecccdbbf
--- /dev/null
+++ b/components/__tests__/form-labels-security.test.tsx
@@ -0,0 +1,28 @@
+import { act, fireEvent, render, screen } from '@testing-library/react';
+import { describe, expect, it } from 'vitest';
+import { unnamedFields } from '@/lib/__tests__/helpers/form-labels';
+import { AccountSecuritySettings } from '@/components/settings/account-security-settings';
+import { useAccountSecurityStore } from '@/stores/account-security-store';
+import { useAuthStore } from '@/stores/auth-store';
+
+// Settings > Security: the password, app password, API key and public key
+// forms name every field (see form-labels.test.tsx).
+
+describe('security settings fields have labels', () => {
+ it('names every field, with each add form open', () => {
+ useAuthStore.setState({ isAuthenticated: false, authMode: 'basic', client: null } as never);
+ useAccountSecurityStore.setState({
+ isStalwart: true, isProbing: false, otpEnabled: false, isSaving: false,
+ isLoadingAuth: false, isLoadingPrincipal: false, displayName: 'Ann',
+ appPasswords: [], apiKeys: [], publicKeys: [],
+ } as never);
+ render(