aboutsummaryrefslogtreecommitdiffstats
path: root/cypress/e2e/files_sharing/public-share/rename-files.cy.ts
blob: 5f2fe00e6506de635c5d58aa9780da143ca45bcb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*!
 * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
 * SPDX-License-Identifier: AGPL-3.0-or-later
 */
import { getRowForFile, haveValidity, triggerActionForFile } from '../../files/FilesUtils.ts'
import { getShareUrl, setupPublicShare } from './setup-public-share.ts'

describe('files_sharing: Public share - renaming files', { testIsolation: true }, () => {

	beforeEach(() => {
		setupPublicShare()
			.then(() => cy.logout())
			.then(() => cy.visit(getShareUrl()))
	})

	it('can rename a file', () => {
		// All are visible by default
		getRowForFile('foo.txt').should('be.visible')

		triggerActionForFile('foo.txt', 'rename')

		getRowForFile('foo.txt')
			.findByRole('textbox', { name: 'Filename' })
			.should('be.visible')
			.type('{selectAll}other.txt')
			.should(haveValidity(''))
			.type('{enter}')

		// See it is renamed
		getRowForFile('other.txt').should('be.visible')
	})
})