I have been trying to implement cypress-angular-unit-test into my existing Angular 9 app.
I have been getting this issue which I'm not sure how to fix. I keep getting this issue in a file that is totally unrelated to my test case.
It seems to think that the Enum is undefined, however we can clearly see that it is not. Also during testing of the app in that area, everything works as expected
also my component and cy-spec.ts files are very simple
any idea why I keep getting this error?I have spent a long time trying to find an answer...
// cy-spec.ts
describe('KitLabelComponent', () => {
beforeEach(() => {
initEnv(KitLabelComponent, {
declarations: [HelptipComponent],
});
});
it('shows label with tooltip', () => {
mount(KitLabelComponent, {
label: 'test label',
tooltipText: 'test tooltip',
});
cy.contains('test label');
});
});
/// component.ts
import { Component, Input } from '@angular/core';
@Component({
selector: 'kit-label',
template: `
<label>
<div>
<span
>{{ label }}
<app-helptip *ngIf="tooltipText" [titleText]="label" [contentText]="tooltipText"></app-helptip>
</span>
</div>
<ng-content></ng-content>
</label>
`,
styleUrls: ['./kit-label.component.less'],
})
export class KitLabelComponent {
@Input() label: string;
@Input() tooltipText: string;
}
question from:
https://stackoverflow.com/questions/65661551/enum-not-recognised-cypress-angular-unit-test 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…