Files
MyMobileAgent/app/e2e/settings.e2e.js

62 lines
2.3 KiB
JavaScript

/**
* 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();
});
});