Skip to content

The agent that grows with you

test(desktop): mark the loud scope note semantically instead of by class

teknium1ca5822b5a53b
diff --git a/apps/desktop/src/app/settings/profile-scope.test.tsx b/apps/desktop/src/app/settings/profile-scope.test.tsx
index 612711380a4..30043f3304b 100644
--- a/apps/desktop/src/app/settings/profile-scope.test.tsx
+++ b/apps/desktop/src/app/settings/profile-scope.test.tsx
@@ -78,10 +78,10 @@ describe('SettingsProfileScope', () => {
expect($settingsScopeOverride.get()).toBeNull()
expect(container.textContent).toContain('scout')
- // The note paragraph is present and accented (font-medium marks the loud variant).
- const note = container.querySelector('p')
+ // The note is present and flagged loud (data-scope-loud marks the accented variant).
+ const note = container.querySelector('[role="status"]')
expect(note).toBeTruthy()
- expect(note?.className).toContain('font-medium')
+ expect(note?.getAttribute('data-scope-loud')).toBe('true')
})
it('shows no note when following the active DEFAULT profile', () => {
@@ -90,7 +90,7 @@ describe('SettingsProfileScope', () => {
const { container } = render(<SettingsProfileScope />)
- expect(container.querySelector('p')).toBeNull()
+ expect(container.querySelector('[role="status"]')).toBeNull()
})
it('keeps the quiet note style for an explicit override onto the default profile', () => {
@@ -102,8 +102,8 @@ describe('SettingsProfileScope', () => {
fireEvent.click(screen.getByRole('button', { name: 'default' }))
expect($settingsScopeOverride.get()).toBe('default')
- const note = document.querySelector('p')
+ const note = document.querySelector('[role="status"]')
expect(note).toBeTruthy()
- expect(note?.className).not.toContain('font-medium')
+ expect(note?.hasAttribute('data-scope-loud')).toBe(false)
})
})
diff --git a/apps/desktop/src/app/settings/profile-scope.tsx b/apps/desktop/src/app/settings/profile-scope.tsx
index 4e5c8667b18..ebdd0d59a32 100644
--- a/apps/desktop/src/app/settings/profile-scope.tsx
+++ b/apps/desktop/src/app/settings/profile-scope.tsx
@@ -82,6 +82,8 @@ export function SettingsProfileScope({ className }: { className?: string }) {
'text-[length:var(--conversation-caption-font-size)] leading-(--conversation-caption-line-height)',
editingNonDefault ? 'font-medium text-(--ui-accent)' : 'text-(--ui-text-tertiary)'
)}
+ data-scope-loud={editingNonDefault ? 'true' : undefined}
+ role="status"
>
{scope.editsProfile(selected)}
</p>
diff --git a/apps/desktop/src/store/settings-scope.test.ts b/apps/desktop/src/store/settings-scope.test.ts
index 7d0e90bf86f..b8d3663085b 100644
--- a/apps/desktop/src/store/settings-scope.test.ts
+++ b/apps/desktop/src/store/settings-scope.test.ts
@@ -85,6 +85,7 @@ describe('settings scope store', () => {
{ is_default: true, name: 'default' },
{ is_default: false, name: 'scout' }
] as unknown as ProfileInfo[]
+
$profiles.set(roster)
// Following the active DEFAULT profile → editing the default.