fix: remove mentioning of context (#1017)
Co-authored-by: Dominik Pschenitschni <mail@celement.de> Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/1017 Reviewed-by: konrad <k@knt.li> Co-authored-by: dpschen <dpschen@noreply.kolaente.de> Co-committed-by: dpschen <dpschen@noreply.kolaente.de>
This commit is contained in:
23
src/directives/cypress.ts
Normal file
23
src/directives/cypress.ts
Normal file
@ -0,0 +1,23 @@
|
||||
import {Directive} from 'vue'
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
Cypress: object;
|
||||
}
|
||||
}
|
||||
|
||||
const cypressDirective: Directive = {
|
||||
mounted(el, {value}) {
|
||||
if (
|
||||
(window.Cypress || import.meta.env.DEV) &&
|
||||
value
|
||||
) {
|
||||
el.setAttribute('data-cy', value)
|
||||
}
|
||||
},
|
||||
beforeUnmount(el) {
|
||||
el.removeAttribute('data-cy')
|
||||
},
|
||||
}
|
||||
|
||||
export default cypressDirective
|
Reference in New Issue
Block a user