🐛(frontend) retry check media status after page reload

Previous refactoring removed the retry logic for
checking media status after a page reload.
This commit reintroduces that functionality
to ensure uploads are properly processed even after
a page reload. We improve the test coverage
to validate this behavior.
This commit is contained in:
Anthony LC
2025-11-04 09:32:04 +01:00
parent ab271bc90d
commit 91217b3c4f
6 changed files with 189 additions and 135 deletions

View File

@@ -494,7 +494,7 @@ test.describe('Doc Editor', () => {
if (request.method().includes('GET')) {
await route.fulfill({
json: {
status: requestCount ? 'ready' : 'processing',
status: requestCount > 1 ? 'ready' : 'processing',
file: '/anything.html',
},
});
@@ -518,6 +518,12 @@ test.describe('Doc Editor', () => {
await fileChooser.setFiles(path.join(__dirname, 'assets/test.html'));
await expect(editor.getByText('Analyzing file...')).toBeVisible();
// To be sure the retry happens even after a page reload
await page.reload();
await expect(editor.getByText('Analyzing file...')).toBeVisible();
// The retry takes a few seconds
await expect(editor.getByText('test.html')).toBeVisible({
timeout: 7000,