diff --git a/libs/design-system/button-toggle/src/lib/button-toggle-size/button-toggle-size.directive.spec.ts b/libs/design-system/button-toggle/src/lib/button-toggle-size/button-toggle-size.directive.spec.ts new file mode 100644 index 000000000..8c50ea6da --- /dev/null +++ b/libs/design-system/button-toggle/src/lib/button-toggle-size/button-toggle-size.directive.spec.ts @@ -0,0 +1,20 @@ +import { Component } from '@angular/core'; +import { render, screen } from '@testing-library/angular'; +import { ToggleButtonSizeDirective } from './button-toggle-size.directive'; + +describe('ButtonToggleSizeDirective', () => { + it('should apply the styles based on the directive', async () => { + @Component({ + template: `
`, + imports: [ToggleButtonSizeDirective], + standalone: true, + }) + class ButtonToggleComponent {} + + await render(ButtonToggleComponent); + + const directive = screen.getByTestId('dir'); + expect(directive.getAttribute('hrabuttontogglesize')).toBe('large'); + expect(directive.style.font).toBe('var(--sys-label-large)'); + }); +}); diff --git a/libs/design-system/button-toggle/src/lib/button-toggle-size/button-toggle-size.directive.ts b/libs/design-system/button-toggle/src/lib/button-toggle-size/button-toggle-size.directive.ts index b2597f08e..fb34ec3ca 100644 --- a/libs/design-system/button-toggle/src/lib/button-toggle-size/button-toggle-size.directive.ts +++ b/libs/design-system/button-toggle/src/lib/button-toggle-size/button-toggle-size.directive.ts @@ -43,9 +43,6 @@ export class ToggleButtonSizeDirective { /** Size of icon button to use */ readonly size = input.required