From 644ec0ed00f2884edff22ef037f341b258837cd9 Mon Sep 17 00:00:00 2001 From: mirivlad Date: Thu, 4 Jun 2026 19:48:02 +0800 Subject: [PATCH] test: cover sync conflict warnings --- scripts/check-gui-render.mjs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/check-gui-render.mjs b/scripts/check-gui-render.mjs index 3eec169..7f0a2bb 100755 --- a/scripts/check-gui-render.mjs +++ b/scripts/check-gui-render.mjs @@ -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,