Closed ersimont closed 1 year ago
export async function getIconButtonHarness( iconName: string, parent: ContentContainerComponentHarness, ): Promise<MatButtonHarness> { const buttons = await parent.getAllHarnesses(MatButtonHarness); for (const button of buttons) { const icons = await button.getAllHarnesses( MatIconHarness.with({ name: iconName }), ); if (icons.length) { return button; } } throw new Error('No button found with icon ' + iconName); }