feat: add end-to-end tests for Agents, Chat, Navigation, and Settings screens

This commit is contained in:
Jonathan Atta
2026-03-03 14:47:44 +01:00
parent 41c7634b75
commit a213b1593a
11 changed files with 363 additions and 6 deletions

61
app/e2e/settings.e2e.js Normal file
View File

@@ -0,0 +1,61 @@
/**
* e2e/settings.e2e.js
*
* Verifies the Settings (Réglages) screen:
* - renders correctly
* - all four theme buttons are tappable
* - theme switches don't crash the app
*/
const { navigatePastSplash, tapTab } = require('./helpers');
describe('Settings Screen', () => {
beforeAll(async () => {
await device.launchApp({ newInstance: true });
await navigatePastSplash();
await tapTab('Réglages');
await waitFor(element(by.text('Settings')))
.toBeVisible()
.withTimeout(5000);
});
// ─── Render ──────────────────────────────────────────────────────────────
it('shows the Settings title', async () => {
await expect(element(by.text('Settings'))).toBeVisible();
});
it('shows all four theme buttons', async () => {
await expect(element(by.id('theme-btn-light'))).toBeVisible();
await expect(element(by.id('theme-btn-system'))).toBeVisible();
await expect(element(by.id('theme-btn-dark'))).toBeVisible();
await expect(element(by.id('theme-btn-neon'))).toBeVisible();
});
// ─── Theme switching ─────────────────────────────────────────────────────
it('switches to Dark theme without crashing', async () => {
await element(by.id('theme-btn-dark')).tap();
await expect(element(by.text('Settings'))).toBeVisible();
});
it('switches to Neon theme without crashing', async () => {
await element(by.id('theme-btn-neon')).tap();
await expect(element(by.text('Settings'))).toBeVisible();
});
it('switches to Light theme without crashing', async () => {
await element(by.id('theme-btn-light')).tap();
await expect(element(by.text('Settings'))).toBeVisible();
});
it('switches to System theme without crashing', async () => {
await element(by.id('theme-btn-system')).tap();
await expect(element(by.text('Settings'))).toBeVisible();
});
it('tapping the already-active theme twice does not crash', async () => {
await element(by.id('theme-btn-light')).tap();
await element(by.id('theme-btn-light')).tap();
await expect(element(by.text('Settings'))).toBeVisible();
});
});