Skip to content

Commit

Permalink
test: additional test
Browse files Browse the repository at this point in the history
additional test
  • Loading branch information
815are committed Oct 18, 2024
1 parent ba2343c commit 1d26456
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/gorgeous-melons-develop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sap-ux/ui-components': minor
---

Added new API method `initTheme` to override default Fluent UI styles, removing `-webkit-font-smoothing: antialiased`.
3 changes: 2 additions & 1 deletion packages/ui-components/src/theme/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { createTheme, loadTheme, Theme } from '@fluentui/react';
import type { Theme } from '@fluentui/react';
import { createTheme, loadTheme } from '@fluentui/react';

export function initTheme(): void {
const appTheme: Theme = createTheme({
Expand Down
14 changes: 14 additions & 0 deletions packages/ui-components/test/unit/theme/Theme.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { initTheme } from '../../../src/theme';
import * as fluentUI from '@fluentui/react';

describe('initTheme', () => {
it('initTheme', () => {
const createThemeSpy = jest.spyOn(fluentUI, 'createTheme');
initTheme();
expect(createThemeSpy).toBeCalledWith({
defaultFontStyle: {
WebkitFontSmoothing: ''
}
});
});
});

0 comments on commit 1d26456

Please sign in to comment.