Skip to content

Commit

Permalink
fix(vr-tests): v8 VR tests are now wrapped with a ThemeProvider by de…
Browse files Browse the repository at this point in the history
…fault (#32962)
  • Loading branch information
TristanWatanabe authored Oct 7, 2024
1 parent 0776fdb commit 8570e81
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/vr-tests/.storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// @ts-check

import { setRTL } from '@fluentui/react/lib/Utilities';
import { ThemeProviderDecorator } from '../src/utilities';

/** @type {import('@storybook/react').Decorator[]} */
export const decorators = [
Expand All @@ -9,6 +10,7 @@ export const decorators = [

return storyFn(context);
},
ThemeProviderDecorator,
];

/** @type {import('@storybook/react').Parameters} */
Expand Down
11 changes: 11 additions & 0 deletions apps/vr-tests/src/utilities/ThemeProviderDecorator.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import * as React from 'react';
import type { Decorator } from '@storybook/react';
import { ThemeProvider } from '@fluentui/react';

/**
* A decorator that wraps the story in a v8 `ThemeProvider` component.
* @returns The decorator function.
*/
export const ThemeProviderDecorator: Decorator = (story, context) => (
<ThemeProvider> {story(context)} </ThemeProvider>
);
1 change: 1 addition & 0 deletions apps/vr-tests/src/utilities/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ export * from './StoryVariantDecorator';
export * from './StoryWrightDecorator';
export * from './TestWrapperDecorator';
export * from './DevOnlyStoryHeader';
export * from './ThemeProviderDecorator';

0 comments on commit 8570e81

Please sign in to comment.