fix: tests

This commit is contained in:
ephraimduncan
2026-01-01 22:46:35 +00:00
parent f4cfa71379
commit d4bee4aed1
@@ -698,7 +698,7 @@ test.describe('File Conversion', () => {
await page.waitForURL(/\/documents\/.*\/edit/, { timeout: 15000 }); await page.waitForURL(/\/documents\/.*\/edit/, { timeout: 15000 });
} catch { } catch {
// Check if error toast appeared (Gotenberg unavailable) // Check if error toast appeared (Gotenberg unavailable)
const errorToast = page.locator('[data-sonner-toast][data-type="error"]'); const errorToast = page.locator('li.destructive');
if (await errorToast.isVisible()) { if (await errorToast.isVisible()) {
test.skip(true, 'Gotenberg conversion service is not available'); test.skip(true, 'Gotenberg conversion service is not available');
return; return;
@@ -819,7 +819,7 @@ test.describe('File Conversion', () => {
try { try {
await page.waitForURL(/\/documents\/.*\/edit/, { timeout: 15000 }); await page.waitForURL(/\/documents\/.*\/edit/, { timeout: 15000 });
} catch { } catch {
const errorToast = page.locator('[data-sonner-toast][data-type="error"]'); const errorToast = page.locator('li.destructive');
if (await errorToast.isVisible()) { if (await errorToast.isVisible()) {
test.skip(true, 'Gotenberg conversion service is not available'); test.skip(true, 'Gotenberg conversion service is not available');
return; return;
@@ -932,7 +932,7 @@ test.describe('File Conversion', () => {
try { try {
await page.waitForURL(/\/documents\/.*\/edit/, { timeout: 15000 }); await page.waitForURL(/\/documents\/.*\/edit/, { timeout: 15000 });
} catch { } catch {
const errorToast = page.locator('[data-sonner-toast][data-type="error"]'); const errorToast = page.locator('li.destructive');
if (await errorToast.isVisible()) { if (await errorToast.isVisible()) {
test.skip(true, 'Gotenberg conversion service is not available'); test.skip(true, 'Gotenberg conversion service is not available');
return; return;
@@ -1140,7 +1140,7 @@ test.describe('File Conversion', () => {
// Wait for either navigation (success) or error toast (Gotenberg down) // Wait for either navigation (success) or error toast (Gotenberg down)
const navigationPromise = page.waitForURL(/\/documents\/.*\/edit/, { timeout: 15000 }); const navigationPromise = page.waitForURL(/\/documents\/.*\/edit/, { timeout: 15000 });
const toastPromise = page.waitForSelector('[data-sonner-toast][data-type="error"]', { const toastPromise = page.waitForSelector('li.destructive', {
timeout: 15000, timeout: 15000,
}); });
@@ -1156,7 +1156,7 @@ test.describe('File Conversion', () => {
if (result === 'toast') { if (result === 'toast') {
// Error toast appeared - Gotenberg is unavailable // Error toast appeared - Gotenberg is unavailable
const errorToast = page.locator('[data-sonner-toast][data-type="error"]'); const errorToast = page.locator('li.destructive');
await expect(errorToast).toBeVisible(); await expect(errorToast).toBeVisible();
} else { } else {
throw new Error('Neither navigation nor error toast occurred'); throw new Error('Neither navigation nor error toast occurred');