feat: add end-to-end tests for Agents, Chat, Navigation, and Settings screens
This commit is contained in:
61
app/e2e/settings.e2e.js
Normal file
61
app/e2e/settings.e2e.js
Normal 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();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user