feat: add end-to-end tests for Agents, Chat, Navigation, and Settings screens
This commit is contained in:
@@ -161,6 +161,7 @@ export default function AgentEditor({ visible, agent, onClose }: Props) {
|
||||
placeholder="Ex: Expert Python"
|
||||
placeholderTextColor={colors.textTertiary}
|
||||
maxLength={60}
|
||||
testID="agent-name-input"
|
||||
/>
|
||||
|
||||
{/* System prompt */}
|
||||
@@ -186,6 +187,7 @@ export default function AgentEditor({ visible, agent, onClose }: Props) {
|
||||
style={[styles.saveBtn, saving && styles.saveBtnSaving]}
|
||||
onPress={handleSave}
|
||||
disabled={saving}
|
||||
testID="agent-save-btn"
|
||||
>
|
||||
{saving ? (
|
||||
<ActivityIndicator color={colors.surface} size="small" />
|
||||
|
||||
@@ -87,6 +87,7 @@ export default function AgentsScreen() {
|
||||
<TouchableOpacity
|
||||
style={styles.deleteBtn}
|
||||
onPress={() => handleDelete(item)}
|
||||
testID={`delete-agent-${item.name.replace(/\s+/g, '-')}`}
|
||||
>
|
||||
<Text style={styles.deleteBtnText}>✕</Text>
|
||||
</TouchableOpacity>
|
||||
@@ -99,8 +100,8 @@ export default function AgentsScreen() {
|
||||
<View style={styles.container}>
|
||||
{/* Header */}
|
||||
<View style={styles.header}>
|
||||
<Text style={styles.headerTitle}>Agents</Text>
|
||||
<TouchableOpacity style={styles.addBtn} onPress={handleNew}>
|
||||
<Text style={styles.headerTitle} testID="agents-screen-title">Agents</Text>
|
||||
<TouchableOpacity style={styles.addBtn} onPress={handleNew} testID="new-agent-btn">
|
||||
<Text style={styles.addBtnText}>+ Nouvel agent</Text>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
|
||||
@@ -35,6 +35,7 @@ export default function ChatInput({
|
||||
multiline
|
||||
maxLength={2000}
|
||||
editable={!disabled}
|
||||
testID="chat-input-field"
|
||||
/>
|
||||
{isGenerating ? (
|
||||
<TouchableOpacity
|
||||
@@ -48,6 +49,7 @@ export default function ChatInput({
|
||||
style={[themeStyles.sendButton, disabled && themeStyles.sendButtonDisabled]}
|
||||
onPress={onSend}
|
||||
disabled={disabled || !value.trim()}
|
||||
testID="chat-send-btn"
|
||||
>
|
||||
<Text style={themeStyles.sendButtonText}>➤</Text>
|
||||
</TouchableOpacity>
|
||||
|
||||
@@ -100,6 +100,7 @@ export default function SettingsScreen({}: Props) {
|
||||
]}
|
||||
onPress={onPress}
|
||||
activeOpacity={0.8}
|
||||
testID={`theme-btn-${it.key}`}
|
||||
>
|
||||
<Text
|
||||
style={[
|
||||
|
||||
@@ -67,10 +67,7 @@ export const ThemeProvider: React.FC<{
|
||||
if (scheme === 'neon') return neonColors;
|
||||
|
||||
// light
|
||||
return {
|
||||
...(lightColors as Record<string, string>),
|
||||
...(lightOverrides as Record<string, string>),
|
||||
} as Record<string, string>;
|
||||
return lightColors as unknown as Record<string, string>;
|
||||
}, [scheme]);
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user