test: add sync plugin E2E tests

This commit is contained in:
mirivlad 2026-06-20 02:39:36 +08:00
parent 589f98011d
commit bb0811a60c
1 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,29 @@
import { test, expect } from '@playwright/test';
test.describe('Sync Plugin Settings', () => {
test('shows setup form when not configured', async ({ page }) => {
await page.goto('/');
await page.click('[data-plugin="verstak.sync"]');
await page.click('[data-action="settings"]');
await expect(page.locator('.sync-setup')).toBeVisible();
await expect(page.locator('input[placeholder="https://example.com"]')).toBeVisible();
});
test('shows status when configured', async ({ page }) => {
await page.goto('/');
await page.evaluate(() => {
localStorage.setItem('verstak-sync-settings', JSON.stringify({
serverUrl: 'https://sync.example.com',
lastStatus: 'connected',
deviceName: 'test-device'
}));
});
await page.click('[data-plugin="verstak.sync"]');
await page.click('[data-action="settings"]');
await expect(page.locator('.sync-info')).toBeVisible();
await expect(page.locator('.status-ok')).toBeVisible();
});
});