Add new directive for UI tests

This commit is contained in:
Felipe Knorr Kuhn
2022-03-19 22:14:37 -07:00
parent ba65d4fd37
commit 53e4fc099c
2 changed files with 15 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
import { Directive, ElementRef, Renderer2 } from '@angular/core';
import { environment } from '../environments/environment';
@Directive({
selector: '[data-cy]'
})
export class DataCyDirective {
constructor(private el: ElementRef, private renderer: Renderer2) {
if (environment.production) {
renderer.removeAttribute(el.nativeElement, 'data-cy');
}
}
}