Skip to content

Commit 9e22cc3

Browse files
committed
test: adjust tests for library changes
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent 48bb792 commit 9e22cc3

4 files changed

Lines changed: 28 additions & 2 deletions

File tree

core/css/fixes.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,15 @@
99
border: 0;
1010
}
1111

12+
/* ---- LIBRARY FIXES ---- */
13+
14+
/**
15+
* TODO: Hotfix for https://github.com/nextcloud-libraries/nextcloud-vue/issues/8783
16+
*
17+
* NcSelect appends its dropdown to the body, but `--vs-dropdown-z-index` is only
18+
* set on the select itself, so the dropdown falls back to the vue-select default
19+
* of 1000 and ends up behind modals (z-index 9998 and above).
20+
*/
21+
.nc-select__dropdown.vs__dropdown-menu {
22+
--vs-dropdown-z-index: 9999;
23+
}

tests/playwright/e2e/files/files-delete.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ test.describe('Files: Delete', () => {
1414
const row = filesListPage.getRowForFile('file.txt')
1515
await expect(row).toBeVisible()
1616
// Preview must finish loading before delete — a loading preview can lock the file
17-
await expect(row.locator('.files-list__row-icon-preview--loaded')).toBeVisible()
17+
await filesListPage.waitForPreviewLoaded('file.txt')
1818

1919
const deleteResponse = page.waitForResponse(
2020
(r) => r.url().includes('/remote.php/dav/files/') && r.request().method() === 'DELETE',

tests/playwright/e2e/files_sharing/public-share/copy-move-rename-files.spec.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,15 @@ const SHARE_NAME = 'shared'
1414
* by a guest.
1515
*/
1616
test.describe('files_sharing: Public share - copy, move and rename files', () => {
17-
test.beforeEach(async ({ user, ownerRequest, publicShare }) => {
17+
test.beforeEach(async ({ user, ownerRequest, publicShare, filesListPage }) => {
1818
await seedSharedFolder(ownerRequest, user, SHARE_NAME)
1919
const share = await createLinkShare(ownerRequest, `/${SHARE_NAME}`, {
2020
permissions: BUNDLED_PERMISSIONS.UPLOAD_AND_UPDATE,
2121
})
2222
await publicShare.open(share.url)
23+
// Every test moves, copies or renames foo.txt, so its preview has to be
24+
// loaded first — a preview being generated locks the file on the server.
25+
await filesListPage.waitForPreviewLoaded('foo.txt')
2326
})
2427

2528
test('can copy a file to another folder', async ({ page, filesListPage, copyMoveDialog }) => {

tests/playwright/support/sections/FilesListPage.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,17 @@ export class FilesListPage {
311311
await moved
312312
}
313313

314+
/**
315+
* Wait for a row's preview thumbnail to be loaded.
316+
*
317+
* Generating a preview locks the file on the server, so a MOVE, COPY or
318+
* DELETE issued while the thumbnail is still being fetched fails with a
319+
* `LockedException`. Await this before any action that writes to the file.
320+
*/
321+
async waitForPreviewLoaded(filename: string): Promise<void> {
322+
await expect(this.getRowForFile(filename).locator('.files-list__row-icon-preview--loaded')).toBeVisible()
323+
}
324+
314325
getFavoriteIconForFile(filename: string): Locator {
315326
return this.getRowForFile(filename).getByRole('img', { name: 'Favorite' })
316327
}

0 commit comments

Comments
 (0)