test: cover sync conflict warnings

This commit is contained in:
mirivlad 2026-06-04 19:48:02 +08:00
parent cc59f928a8
commit 644ec0ed00
1 changed files with 6 additions and 3 deletions

View File

@ -122,6 +122,9 @@ async function runReadyScenario(cdp, url) {
await assertEval(cdp, `[...document.querySelectorAll('.settings-nav-icon')].every((el) => el.textContent.trim() === '')`, 'settings: no text glyph icons remain')
await clickText(cdp, '.settings-nav-item', 'Синхронизация')
await assertText(cdp, 'Настройте подключение к серверу синхронизации.', 'settings: sync section opens')
await clickText(cdp, '.sync-actions .btn', 'Синхронизировать сейчас')
await assertText(cdp, 'Конфликты: 1', 'settings: sync conflict warning visible')
await assertText(cdp, 'Ошибки применения: 1', 'settings: sync apply error warning visible')
await clickText(cdp, '.settings-nav-item', 'Шаблоны')
await assertText(cdp, 'Шаблоны', 'settings: templates section opens')
await clickText(cdp, '.settings-nav-item', 'Рабочее пространство')
@ -741,9 +744,9 @@ function wailsMockSource() {
GetWorklogEntryEvents: async () => [],
SaveWorklogReport: async (format) => 'saved ' + format,
SyncStatus: async () => ({ configured: false, connected: false, revoked: false, unpushedOps: 0 }),
GetSyncSettings: async () => ({ enabled: false, serverUrl: '', syncInterval: 0, lastStatus: 'disabled' }),
SyncNow: async () => ({ pushed: 0, pulled: 0, conflicts: [], applyErrors: [] }),
SyncStatus: async () => ({ configured: true, serverUrl: 'https://sync.example.test', deviceId: 'smoke-device', deviceName: 'Smoke Device', connected: true, revoked: false, unpushedOps: 0 }),
GetSyncSettings: async () => ({ enabled: true, serverUrl: 'https://sync.example.test', deviceId: 'smoke-device', deviceName: 'Smoke Device', syncInterval: 0, lastStatus: 'connected' }),
SyncNow: async () => ({ pushed: 0, pulled: 0, conflicts: [{ entityId: 'node-project' }], applyErrors: [{ opId: 'remote-op-1', error: 'smoke apply error' }] }),
SyncTestConnection: async () => true,
SyncConfigure: async () => true,
SyncSetInterval: async () => true,