feat: clarify web library memory and conversation management
Rebuild & Deploy / rebuild (push) Failing after 17s
Rebuild & Deploy / rebuild (push) Failing after 17s
This commit is contained in:
1 parent
3183ebaea7
commit
41ca590744
11 files changed
+767
-70
No files matched your search
@@ -18,7 +18,7 @@ def settings_page():
|
||||
'users': [dict(id='bob', username='bob', display_name='Bob', role='user', status='error', container_name='hope-hermes-bob', error='Provisioning failed')],
|
||||
'preferences': dict(palette='opal', appearance='light', revision=1),
|
||||
'model': dict(model='auto', thinking_level='none'),
|
||||
'memory': True, 'appearance_error': False, 'calls': [], 'errors': [],
|
||||
'memory': True, 'appearance_error': False, 'capability_error': False, 'calls': [], 'errors': [],
|
||||
}
|
||||
page.on('pageerror', lambda error: state['errors'].append(str(error)))
|
||||
|
||||
@@ -32,7 +32,10 @@ def settings_page():
|
||||
request.fulfill(status=401, json={'error': 'Sign in required'}); return
|
||||
data = {'user': state['user']}
|
||||
elif path == '/api/auth/logout': data = {'ok': True}
|
||||
elif path == '/api/capabilities': data = {'features': {'memory_controls': state['memory']}}
|
||||
elif path == '/api/capabilities':
|
||||
if state['capability_error']:
|
||||
request.fulfill(status=503, json={'error': 'File support unavailable'}); return
|
||||
data = {'features': {'memory_controls': state['memory']}}
|
||||
elif path == '/api/research': data = {'available': False}
|
||||
elif path == '/api/preferences':
|
||||
if state['appearance_error']:
|
||||
@@ -185,6 +188,48 @@ def test_appearance_revision_save_failure_and_memory_real_controls(settings_page
|
||||
assert page.locator('[data-settings-panel="privacy"] #featureStatus').count() == 0
|
||||
|
||||
|
||||
def test_mobile_activity_closes_drawer_and_task_fields_stack(settings_page):
|
||||
page, state = settings_page
|
||||
page.locator('#drawerOpen').click()
|
||||
page.locator('#tasksBtn').click()
|
||||
expect(page.locator('#chatSidebar')).not_to_have_class('chat-sidebar drawer-open')
|
||||
expect(page.locator('#drawerBackdrop')).to_be_hidden()
|
||||
expect(page.locator('#tasksPanel')).to_be_visible()
|
||||
expect(page.locator('#closeTasksBtn')).to_be_focused()
|
||||
page.locator('#closeTasksBtn').click()
|
||||
expect(page.locator('#drawerOpen')).to_be_focused()
|
||||
|
||||
|
||||
def test_model_save_file_support_failure_has_working_retry(settings_page):
|
||||
page, state = settings_page
|
||||
open_section(page, 'preferences')
|
||||
state['capability_error'] = True
|
||||
page.locator('#thinkingLevelSelect').select_option('high')
|
||||
page.locator('#saveModelSettings').click()
|
||||
expect(page.locator('#modelSettingsStatus')).to_contain_text('file support could not be checked')
|
||||
expect(page.locator('#retryModelSettings')).to_be_visible()
|
||||
before = len([call for call in state['calls'] if call[1] == '/api/capabilities'])
|
||||
state['capability_error'] = False
|
||||
page.locator('#retryModelSettings').click()
|
||||
expect(page.locator('#modelSettingsStatus')).to_contain_text('saved settings are loaded')
|
||||
expect(page.locator('#retryModelSettings')).to_be_hidden()
|
||||
page.wait_for_function("document.getElementById('featureAvailability').textContent.includes('Files are unavailable.')")
|
||||
assert len([call for call in state['calls'] if call[1] == '/api/capabilities']) > before
|
||||
|
||||
|
||||
def test_security_explains_real_connection_and_signs_out(settings_page):
|
||||
page, state = settings_page
|
||||
open_section(page, 'security')
|
||||
expect(page.locator('#securityServer')).to_have_text('hope.test')
|
||||
expect(page.locator('#securityConnection')).to_contain_text('HTTPS')
|
||||
expect(page.locator('#securityIdentity')).to_contain_text('@alice')
|
||||
assert page.locator('[data-settings-panel="security"] input').count() == 0
|
||||
page.get_by_role('button', name='Sign out of this browser', exact=True).click()
|
||||
expect(page.locator('#settingsDialog')).not_to_be_visible()
|
||||
expect(page.locator('#loginGate')).to_be_visible()
|
||||
assert any(method == 'POST' and path == '/api/auth/logout' for method, path, _ in state['calls'])
|
||||
|
||||
|
||||
def test_preferences_preserve_active_voice_and_model_owner(settings_page):
|
||||
page, state = settings_page
|
||||
page.evaluate("window.voiceEvents=[];window.addEventListener('hope:voice-state',e=>voiceEvents.push(e.detail));window.dispatchEvent(new CustomEvent('hope:voice-state',{detail:{active:true}}))")
|
||||
|
||||
Reference in new issue
Block a user