File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
components-test-utils/src Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -59,12 +59,11 @@ export interface ComponentsProviderProps
5959 * StyledDefender is a utility component that attempts to ensure that a few common
6060 * styles are injected at any point where @looker/components are injected into the DOM.
6161 * When taking code-snapshots (a pattern we generally discourage) the `StyleDefender`
62- * may be visible in output. Enabling `snapshotMode` disables StyleDefender to narrow
63- * snapshot output.
62+ * may be visible in output so we generally recommend disabling it for those use-cases.
6463 *
6564 * @default false
6665 */
67- snapshotMode ?: boolean
66+ disableStyleDefender ?: boolean
6867
6968 /**
7069 * Prevent automatic injection of a basic CSS-reset into the DOM
@@ -101,7 +100,7 @@ export const ComponentsProvider: FC<ComponentsProviderProps> = ({
101100 children,
102101 loadFontSources = true ,
103102 loadGoogleFonts = false ,
104- snapshotMode = false ,
103+ disableStyleDefender = false ,
105104 locale,
106105 resources,
107106 themeCustomizations,
@@ -125,7 +124,9 @@ export const ComponentsProvider: FC<ComponentsProviderProps> = ({
125124
126125 useI18n ( { locale, resources } )
127126
128- const ConditionalStyleDefender = snapshotMode ? Fragment : StyleDefender
127+ const ConditionalStyleDefender = disableStyleDefender
128+ ? Fragment
129+ : StyleDefender
129130
130131 return (
131132 < HelmetProvider >
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ import 'jest-styled-components'
3030import React , { ReactElement } from 'react'
3131
3232export const withThemeProvider = ( Component : ReactElement < any > ) => (
33- < ComponentsProvider snapshotMode > { Component } </ ComponentsProvider >
33+ < ComponentsProvider disableStyleDefender > { Component } </ ComponentsProvider >
3434)
3535
3636export const renderWithTheme = (
You can’t perform that action at this time.
0 commit comments