I'm trying to test if the method "changeValueCodeCompteurCET" is called when the "onValueChanged" event is emited. I tried a lot of times, but without any success (The code is bellow). Can u help find the problem in my code. Thank you for your answers.
HTML CODE
<dx-form
[colCount]="2"
labelLocation="top">
<dxi-item itemType="group">
<dxi-item
dataField="Code compteur CET"
editorType="dxSelectBox"
[editorOptions]="{ dataSource:codeCompteurCETDataSource, displayExpr:'Designation', valueExpr:'Code', value:codeCompteurCET, onValueChanged:changeValueCodeCompteurCET, showClearButton:true}">
</dxi-item>
...
TYPESCRIPT CODE
it("should call 'changeValuePlafond' when the input value changes", ()=>{
let spy_changeValueCodeCompteurCET = spyOn(component, "changeValueCodeCompteurCET");
let dxForm = fixture.debugElement.query(By.css("dx-form"));
let dxiItem = dxForm.componentInstance.items[0].items[0];
dxiItem.editorOptions.onValueChanged.emit();
fixture.detectChanges();
expect(spy_changeValueCodeCompteurCET).toHaveBeenCalledTimes(1);
});