]> source.dussan.org Git - nextcloud-server.git/commitdiff
test: Adjust Cypress setup to support mainline JS syntax
authorFerdinand Thiessen <opensource@fthiessen.de>
Wed, 30 Oct 2024 12:37:18 +0000 (13:37 +0100)
committerFerdinand Thiessen <opensource@fthiessen.de>
Thu, 7 Nov 2024 16:37:44 +0000 (17:37 +0100)
TODO: Drop when we support Node 22.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
cypress/e2e/files/files-renaming.cy.ts
cypress/support/component.ts
cypress/support/e2e.ts

index 6ba32989aa4ee0bbb015d7b9c47436a15c919a0f..1bb2a530fe8bb59ab962d7e793704b48d5e1bfec 100644 (file)
@@ -5,6 +5,7 @@
 
 import type { User } from '@nextcloud/cypress'
 import { getRowForFile, renameFile, triggerActionForFile } from './FilesUtils'
+import { assertNotExistOrNotVisible } from '../settings/usersUtils'
 
 const haveValidity = (validity: string | RegExp) => {
        if (typeof validity === 'string') {
@@ -139,11 +140,15 @@ describe('files: Rename nodes', { testIsolation: true }, () => {
                getRowForFile('file.txt').should('be.visible')
                // Z so it is shown last
                renameFile('file.txt', 'zzz.txt')
+
                // not visible any longer
-               getRowForFile('zzz.txt').should('not.be.visible')
+               getRowForFile('zzz.txt')
+                       .should(assertNotExistOrNotVisible)
+
                // scroll file list to bottom
                cy.get('[data-cy-files-list]').scrollTo('bottom')
                cy.screenshot()
+
                // The file is no longer in rename state
                getRowForFile('zzz.txt')
                        .should('be.visible')
index ea370ae6d06375aaccf0095656775847d98faf30..d00bef722d53545a080d5d9c02e5fdf1ff533469 100644 (file)
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  */
+
+// TODO: Drop once we use Node 22
+import 'core-js/stable/index.js'
+
+// Commands
 import 'cypress-axe'
 
 /* eslint-disable */
index ff888fe7d5a331f083621d8154da418cb5c9c8e4..0cf61405155bfb510d33b3fcbe8106497c9e368f 100644 (file)
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  */
+
+// TODO: Drop once we use Node 22
+import 'core-js/stable/index.js'
+
+// Commands
 import 'cypress-axe'
 import './commands.ts'