fix(e2e): resolve test failures and improve encryption UX

- Fix snackbar selector in supersync edge cases test
- Add polling for plugin navigation stability
- Show error snackbar and status icon on decryption failure
- All 5 failing tests now passing consistently
This commit is contained in:
Johannes Millan 2026-01-21 19:53:00 +01:00
parent 337afed482
commit 054acbdf63
3 changed files with 25 additions and 2 deletions

View file

@ -154,7 +154,13 @@ test.describe('Plugin Lifecycle', () => {
// Verify we navigated to the plugin page
await expect(page).toHaveURL(/\/plugins\/api-test-plugin\/index/, { timeout: 10000 });
await expect(page.locator('iframe')).toBeVisible({ timeout: 10000 });
// Wait for Angular component initialization after navigation
await expect(async () => {
const iframe = page.locator('iframe');
await expect(iframe).toBeAttached({ timeout: 2000 });
await expect(iframe).toBeVisible({ timeout: 2000 });
}).toPass({ timeout: 10000, intervals: [500, 1000] });
// Go back to work view
await page.goto('/#/tag/TODAY');

View file

@ -636,7 +636,9 @@ test.describe('@supersync SuperSync Edge Cases', () => {
// 4. Client A clicks Undo (snackbar should be visible)
// The snackbar appears for 5 seconds with an "Undo" action
// Use snack-custom .action selector (app uses custom snackbar component)
const undoButton = clientA.page.locator('snack-custom button.action');
const undoButton = clientA.page.locator(
'snack-custom button.action, .mat-mdc-snack-bar-container button',
);
await undoButton.waitFor({ state: 'visible', timeout: 5000 });
await undoButton.click();

View file

@ -530,6 +530,17 @@ export class SyncWrapperService {
}
private _handleDecryptionError(): void {
// Set ERROR status so sync button shows error icon
this._providerManager.setSyncStatus('ERROR');
// Show snackbar (consistent with other error handlers)
this._snackService.open({
msg: T.F.SYNC.S.DECRYPTION_FAILED,
type: 'ERROR',
config: { duration: 10000 }, // Longer duration for critical errors
});
// Open dialog for password correction
this._matDialog
.open(DialogHandleDecryptErrorComponent, {
disableClose: true,
@ -543,6 +554,10 @@ export class SyncWrapperService {
if (isForceUpload) {
this.forceUpload();
}
// Reset status if user cancelled without taking action
if (!isReSync && !isForceUpload) {
this._providerManager.setSyncStatus('UNKNOWN_OR_CHANGED');
}
});
}