Skip to content

Instantly share code, notes, and snippets.

@lcoenen
Created December 23, 2019 12:54
Show Gist options
  • Save lcoenen/55072090bacf4f000dafeb4d56c8ea9e to your computer and use it in GitHub Desktop.
Save lcoenen/55072090bacf4f000dafeb4d56c8ea9e to your computer and use it in GitHub Desktop.
it.only('should pass extend and remove from more-option component', () => {
spyOn(component.extend, 'emit');
const suppressed = generateMockSuppressed();
const moreOptions = fixture.debugElement.query(By.directive(DSAMoreOptionsComponent));
// moreOptions doens't return anything
moreOptions.triggerEventHandler('remove', {element: suppressed});
expect(suppressed.expect.emit).toHaveBeenCalledWith({element: suppressed});
moreOptions.triggerEventHandler('extend', {delay: 48, element: suppressed});
expect(suppressed.expect.emit).toHaveBeenCalledWith({delay: 48, element: suppressed});
})
// But it exists in the table
<ng-container matColumnDef="moreOptions">
<th mat-header-cell *matHeaderCellDef></th>
<td mat-cell *matCellDef="let element" class="right-align">
<taas-dsa-more-options
[element]="element"
(extend)="onExtend($event)"
(remove)="onRemove($event)"
></taas-dsa-more-options>
</td>
</ng-container>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment