mirror of
https://github.com/nextcloud/server.git
synced 2026-11-02 20:11:47 +01:00
- resolves https://github.com/nextcloud/server/issues/59203 - resolves https://github.com/nextcloud/server/issues/56611 In the files list before this the accessible name of the button (default action) was overridden to the default action display name. But this causes problem for screen readers because then the whole table row is just called "view" or "download" instead of using the inner text (e.g. "filename.txt"). This fixes it to rename it `ACTION: FILENAME` instead. Also when long names were truncated there were no useful title (tooltip) for it, so it was not possible to get the real name. This is fixed by always provide a proper tooltip including the full name. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
77 lines
2.3 KiB
TypeScript
77 lines
2.3 KiB
TypeScript
/*
|
|
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
*/
|
|
|
|
import { runOcc } from '@nextcloud/e2e-test-server/docker'
|
|
import { expect, test } from '../../support/fixtures/files-page.ts'
|
|
import { AuthBackend, createStorageWithConfig, StorageBackend, verifyStorage } from '../../support/utils/files_external.ts'
|
|
|
|
// Each test creates a *personal* (`--user`) storage, mounted only for its own
|
|
// random user, so these run fully in parallel without interfering with each
|
|
// other or with any other files test.
|
|
test.beforeAll(async () => {
|
|
await runOcc(['app:enable', 'files_external'])
|
|
})
|
|
|
|
const invalidHost = 'http://cloud.domain.com/remote.php/dav/files/abcdef123456'
|
|
|
|
test('Create a failed user storage with invalid url', async ({ page, user, filesListPage }) => {
|
|
const id = await createStorageWithConfig(
|
|
'Storage1',
|
|
StorageBackend.DAV,
|
|
AuthBackend.LoginCredentials,
|
|
{ host: invalidHost, secure: 'false' },
|
|
user,
|
|
)
|
|
await verifyStorage(id)
|
|
|
|
await filesListPage.open()
|
|
|
|
// The mount may not be in the first PROPFIND; reload once if it is missing yet
|
|
const row = filesListPage.getRowForFile('Storage1')
|
|
if (!await row.isVisible()) {
|
|
await page.reload()
|
|
}
|
|
|
|
await expect(row).toBeVisible()
|
|
await expect(filesListPage.getRowNameLinkForFile('Storage1'))
|
|
.toHaveAttribute('title', / \(unavailable\)$/)
|
|
|
|
// Clicking an unavailable storage must not open it (location stays the same)
|
|
const url = page.url()
|
|
await filesListPage.getRowNameLinkForFile('Storage1').click()
|
|
expect(page.url()).toBe(url)
|
|
})
|
|
|
|
test('Create a failed user storage with invalid login credentials', async ({ page, user, filesListPage }) => {
|
|
const id = await createStorageWithConfig(
|
|
'Storage2',
|
|
StorageBackend.DAV,
|
|
AuthBackend.Password,
|
|
{
|
|
host: invalidHost,
|
|
user: 'invaliduser',
|
|
password: 'invalidpassword',
|
|
secure: 'false',
|
|
},
|
|
user,
|
|
)
|
|
await verifyStorage(id)
|
|
|
|
await filesListPage.open()
|
|
|
|
const row = filesListPage.getRowForFile('Storage2')
|
|
if (!await row.isVisible()) {
|
|
await page.reload()
|
|
}
|
|
|
|
await expect(row).toBeVisible()
|
|
await expect(filesListPage.getRowNameLinkForFile('Storage2'))
|
|
.toHaveAttribute('title', / \(unavailable\)$/)
|
|
|
|
const url = page.url()
|
|
await filesListPage.getRowNameLinkForFile('Storage2').click()
|
|
expect(page.url()).toBe(url)
|
|
})
|