rename-files.cy.ts 922 B

1234567891011121314151617181920212223242526272829303132
  1. /*!
  2. * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
  3. * SPDX-License-Identifier: AGPL-3.0-or-later
  4. */
  5. import { getRowForFile, haveValidity, triggerActionForFile } from '../../files/FilesUtils.ts'
  6. import { getShareUrl, setupPublicShare } from './setup-public-share.ts'
  7. describe('files_sharing: Public share - renaming files', { testIsolation: true }, () => {
  8. beforeEach(() => {
  9. setupPublicShare()
  10. .then(() => cy.logout())
  11. .then(() => cy.visit(getShareUrl()))
  12. })
  13. it('can rename a file', () => {
  14. // All are visible by default
  15. getRowForFile('foo.txt').should('be.visible')
  16. triggerActionForFile('foo.txt', 'rename')
  17. getRowForFile('foo.txt')
  18. .findByRole('textbox', { name: 'Filename' })
  19. .should('be.visible')
  20. .type('{selectAll}other.txt')
  21. .should(haveValidity(''))
  22. .type('{enter}')
  23. // See it is renamed
  24. getRowForFile('other.txt').should('be.visible')
  25. })
  26. })