Skip to content

Commit

Permalink
Added few tests for dropdown component for code coverage to increase
Browse files Browse the repository at this point in the history
  • Loading branch information
rmathew1011 committed Feb 1, 2021
1 parent 38d361c commit 5f9376e
Showing 1 changed file with 35 additions and 1 deletion.
36 changes: 35 additions & 1 deletion src/app/tl-drop-down/tl-drop-down.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ describe('TlDropDownComponent', () => {
.toEqual('mouseover');
});

it('should have customization tfor dropdown display type', () => {
it('should have customization for dropdown display type', () => {
expect(component.toggleOn)
.toEqual('click');
component.toggleOn = 'mouseover';
Expand Down Expand Up @@ -222,4 +222,38 @@ describe('TlDropDownComponent', () => {
.toEqual('var(--tl-btn-primary-hover-border)');
});

it("should have as default value for menuYOffset '-6px'", () => {
expect(component.menuYOffset)
.toEqual('-6px');
});

it("should have as default toggle value 'click'", () => {
expect(component.toggleOn)
.toEqual('click');
});

it('should have customization of the button color based on theme variant', () => {
expect(component.btnColor)
.toEqual('var(--tl-btn-undefined-color)');
component.themeVariant = 'primary';
expect(component.btnColor)
.toEqual('var(--tl-btn-primary-color)');
});

it('should have customization of the button color on hover based on theme variant', () => {
expect(component.btnColorHover)
.toEqual('var(--tl-btn-undefined-hover-color)');
component.themeVariant = 'primary';
expect(component.btnColorHover)
.toEqual('var(--tl-btn-primary-hover-color)');
});

it('should have customization of the button text decoration on hover based on theme variant', () => {
expect(component.btnTextDecorationHover)
.toEqual('var(--tl-btn-undefined-hover-color)');
component.themeVariant = 'primary';
expect(component.btnTextDecorationHover)
.toEqual('var(--tl-btn-primary-hover-color)');
});

});

0 comments on commit 5f9376e

Please sign in to comment.