Skip to content

Commit

Permalink
fix(text): add missing test line for coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
skhamvon committed Oct 3, 2023
1 parent a2c99a4 commit 3023690
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ describe('spec:osds-text', () => {
expect(textSlot).toBeTruthy();
});

it('should have set a style variable', async () => {
const styleVar = '--osds-text-color-specific-hue: var(--ods-color-default-500);';
await setup({ attributes: {} });
expect(root?.getAttribute('style')).toBe(styleVar);
});

describe('attributes', () => {
const config = {
instance: () => instance,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class OsdsText implements OdsTextAttribute {
return (
<Host {...{
style: {
'--osds-text-color-specific-hue': this.color && this.hue ? `var(${odsGenerateColorVariable(this.color, this.hue)})` : '',
'--osds-text-color-specific-hue': `var(${odsGenerateColorVariable(this.color!, this.hue!)})`,
}
}}>
<slot></slot>
Expand Down

0 comments on commit 3023690

Please sign in to comment.