I have used MockComponent(FormComponent) inside spec.ts
describe('editing point', () => {
const createComponent = createComponentFactory({
component: PointDialogComponent,
imports: [MockComponent(PointFormComponent)],
});
beforeEach(() => {
spectator = createComponent({});
});
it('should create', () => expect(spectator.component).toBeTruthy());
});
So when I run this test I got error:
PointDialogComponent › editing point › should create
TypeError: Cannot read properties of undefined (reading ‘length’)
I figured out it is thrown when I added this line: PointAction = PointAction; to PointFormComponent
export enum PointAction {
CREATE,
EDIT,
}
Any solution for this? I can’t figured out why I keep getting this error.
1