chore: remove Cypress component testing
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>pull/55747/head
parent
3f6f277dba
commit
a66135f32f
@ -1,16 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
- SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
|
||||
- SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<title>Components App</title>
|
||||
</head>
|
||||
<body>
|
||||
<div data-cy-root></div>
|
||||
</body>
|
||||
</html>
|
||||
@ -1,43 +0,0 @@
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import { mount } from '@cypress/vue2'
|
||||
|
||||
import '@testing-library/cypress/add-commands'
|
||||
import 'cypress-axe'
|
||||
// styles
|
||||
import '../../apps/theming/css/default.css'
|
||||
import '../../core/css/server.css'
|
||||
|
||||
Cypress.Commands.add('mount', (component, options = {}) => {
|
||||
// Setup options object
|
||||
options.extensions = options.extensions || {}
|
||||
options.extensions.plugins = options.extensions.plugins || []
|
||||
options.extensions.components = options.extensions.components || {}
|
||||
|
||||
return mount(component, options)
|
||||
})
|
||||
|
||||
Cypress.Commands.add('mockInitialState', (app: string, key: string, value: unknown) => {
|
||||
cy.document().then(($document) => {
|
||||
const input = $document.createElement('input')
|
||||
input.setAttribute('type', 'hidden')
|
||||
input.setAttribute('id', `initial-state-${app}-${key}`)
|
||||
input.setAttribute('value', btoa(JSON.stringify(value)))
|
||||
$document.body.appendChild(input)
|
||||
})
|
||||
})
|
||||
|
||||
Cypress.Commands.add('unmockInitialState', (app?: string, key?: string) => {
|
||||
cy.window().then(($window) => {
|
||||
// @ts-expect-error internal value
|
||||
delete $window._nc_initial_state
|
||||
})
|
||||
|
||||
cy.document().then(($document) => {
|
||||
$document.querySelectorAll('body > input[type="hidden"]' + (app ? `[id="initial-state-${app}-${key}"]` : ''))
|
||||
.forEach((node) => $document.body.removeChild(node))
|
||||
})
|
||||
})
|
||||
@ -1,17 +0,0 @@
|
||||
/*!
|
||||
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import type { mount } from '@cypress/vue2'
|
||||
|
||||
declare global {
|
||||
|
||||
namespace Cypress {
|
||||
interface Chainable {
|
||||
mount: typeof mount
|
||||
mockInitialState: (app: string, key: string, value: unknown) => Cypress.Chainable<void>
|
||||
unmockInitialState: (app?: string, key?: string) => Cypress.Chainable<void>
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue