@fluentui-react-native/default-theme 0.14.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,48 @@
1
+ import { defaultFluentTheme, defaultFluentDarkTheme } from '../defaultTheme';
2
+ import { createDefaultTheme } from '../createDefaultTheme';
3
+ import { createColorAliasTokens, createShadowAliasTokens } from '../createAliasTokens';
4
+ import { ThemeOptions, AppearanceOptions } from '@fluentui-react-native/theme-types';
5
+
6
+ const defaultThemeOptions: ThemeOptions[][] = [
7
+ [{ appearance: 'light', defaultAppearance: 'light' }],
8
+ [{ appearance: 'dark', defaultAppearance: 'light' }],
9
+ [{ appearance: 'highContrast', defaultAppearance: 'light' }],
10
+ [{ appearance: undefined, defaultAppearance: 'light' }],
11
+ [{ appearance: 'dynamic', defaultAppearance: 'light' }],
12
+ ];
13
+
14
+ const appearanceOptions: AppearanceOptions[] = ['light', 'dark', 'highContrast'];
15
+
16
+ beforeAll(() => {
17
+ jest.mock('react-native/Libraries/Utilities/Appearance', () => ({
18
+ getColorScheme: () => 'dark',
19
+ addChangeListener: () => null,
20
+ }));
21
+ });
22
+
23
+ it('defaultFluentTheme test', () => {
24
+ expect(defaultFluentTheme).toMatchSnapshot();
25
+ });
26
+
27
+ it('defaultFluentDarkTheme test', () => {
28
+ expect(defaultFluentDarkTheme).toMatchSnapshot();
29
+ });
30
+
31
+ describe('createDefaultTheme test', () => {
32
+ it.concurrent.each(defaultThemeOptions)('themeOption - %o', async (themeOption: ThemeOptions) => {
33
+ const defaultTheme = createDefaultTheme(themeOption).theme;
34
+ expect(defaultTheme).toMatchSnapshot();
35
+ });
36
+ });
37
+
38
+ describe('createColorAliasTokens test', () => {
39
+ it.concurrent.each(appearanceOptions)('appearanceOptions - %s', async (appearanceOption: AppearanceOptions) => {
40
+ expect(createColorAliasTokens(appearanceOption)).toMatchSnapshot();
41
+ });
42
+ });
43
+
44
+ describe('createShadowAliasTokens test', () => {
45
+ it.concurrent.each(appearanceOptions)('appearanceOptions - %s', async (appearanceOption: AppearanceOptions) => {
46
+ expect(createShadowAliasTokens(appearanceOption)).toMatchSnapshot();
47
+ });
48
+ });