duplicated-node-regression.cy.ts 923 B

123456789101112131415161718192021222324252627282930313233
  1. /**
  2. * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
  3. * SPDX-License-Identifier: AGPL-3.0-or-later
  4. */
  5. import { createFolder, getRowForFile, triggerActionForFile } from './FilesUtils.ts'
  6. before(() => {
  7. cy.createRandomUser()
  8. .then((user) => {
  9. cy.mkdir(user, '/only once')
  10. cy.login(user)
  11. cy.visit('/apps/files')
  12. })
  13. })
  14. /**
  15. * Regression test for https://github.com/nextcloud/server/issues/47904
  16. */
  17. it('Ensure nodes are not duplicated in the file list', () => {
  18. // See the folder
  19. getRowForFile('only once').should('be.visible')
  20. // Delete the folder
  21. cy.intercept('DELETE', '**/remote.php/dav/**').as('deleteFolder')
  22. triggerActionForFile('only once', 'delete')
  23. cy.wait('@deleteFolder')
  24. getRowForFile('only once').should('not.exist')
  25. // Create the folder again
  26. createFolder('only once')
  27. // See folder exists only once
  28. getRowForFile('only once')
  29. .should('have.length', 1)
  30. })