Skip to content

Commit 362610e

Browse files
committed
Fix more usages
1 parent 1721e1b commit 362610e

File tree

6 files changed

+43
-43
lines changed

6 files changed

+43
-43
lines changed

packages/color/test/index.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import { jsx } from '@theme-ui/core'
77
import { Theme, ThemeUICSSObject } from '@theme-ui/css'
8-
import { ThemeProvider } from '@theme-ui/theme-provider'
8+
import { ThemeUIProvider } from '@theme-ui/theme-provider'
99
import { render } from '@theme-ui/test-utils'
1010
import { matchers } from '@emotion/jest'
1111

@@ -259,10 +259,10 @@ test('alphaRgbaCustomProps', () => {
259259
expect(n).toBe('rgba(255,0,0,0.25)')
260260
})
261261

262-
describe('colors inside ThemeProvider', () => {
262+
describe('colors inside ThemeUIProvider', () => {
263263
test('__default color is darkened', () => {
264264
const tree = render(
265-
<ThemeProvider
265+
<ThemeUIProvider
266266
theme={{
267267
colors: {
268268
primary: {
@@ -273,7 +273,7 @@ describe('colors inside ThemeProvider', () => {
273273
}}
274274
>
275275
<button sx={{ color: darken('primary', 0.1) }}>Click me</button>
276-
</ThemeProvider>
276+
</ThemeUIProvider>
277277
)
278278

279279
expect(tree.getByRole('button')).toHaveStyleRule('color', '#09c')
@@ -292,7 +292,7 @@ describe('colors inside ThemeProvider', () => {
292292
type MyTheme = typeof theme & { rawColors: typeof theme.colors }
293293

294294
const tree = render(
295-
<ThemeProvider theme={theme}>
295+
<ThemeUIProvider theme={theme}>
296296
<button
297297
sx={{
298298
color: (theme) => {
@@ -306,7 +306,7 @@ describe('colors inside ThemeProvider', () => {
306306
>
307307
Click me
308308
</button>
309-
</ThemeProvider>
309+
</ThemeUIProvider>
310310
)
311311

312312
expect(tree.getByRole('button')).toHaveStyleRule('color', '#80d1f2')
@@ -325,7 +325,7 @@ describe('colors inside ThemeProvider', () => {
325325
type MyTheme = typeof theme & { rawColors: typeof theme.colors }
326326

327327
const tree = render(
328-
<ThemeProvider theme={theme}>
328+
<ThemeUIProvider theme={theme}>
329329
<button
330330
sx={{
331331
color: (theme) => lighten(theme.rawColors?.blue, 0.1)(theme),
@@ -341,7 +341,7 @@ describe('colors inside ThemeProvider', () => {
341341
>
342342
Hello
343343
</p>
344-
</ThemeProvider>
344+
</ThemeUIProvider>
345345
)
346346

347347
expect(tree.getByRole('button')).toHaveStyleRule('color', '#33f')

packages/core/test/index.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
__ThemeUIContext,
1111
useThemeUI,
1212
merge,
13-
ThemeUIProvider,
13+
ThemeProvider,
1414
ThemeUIContextValue,
1515
Theme,
1616
} from '../src'
@@ -19,12 +19,12 @@ afterEach(cleanup)
1919

2020
expect.extend(matchers)
2121

22-
describe('ThemeUIProvider', () => {
22+
describe('ThemeProvider', () => {
2323
test('renders', () => {
2424
const json = renderJSON(
25-
<ThemeUIProvider theme={{}}>
25+
<ThemeProvider theme={{}}>
2626
<h1>Hello</h1>
27-
</ThemeUIProvider>
27+
</ThemeProvider>
2828
)
2929
expect(json).toMatchSnapshot()
3030
})
@@ -38,7 +38,7 @@ describe('ThemeUIProvider', () => {
3838
theme: {},
3939
}}
4040
>
41-
<ThemeUIProvider theme={{}}>Conflicting versions</ThemeUIProvider>
41+
<ThemeProvider theme={{}}>Conflicting versions</ThemeProvider>
4242
</__ThemeUIContext.Provider>
4343
)
4444
expect(console.warn).toBeCalled()
@@ -54,10 +54,10 @@ describe('ThemeUIProvider', () => {
5454
const theme = jest.fn(() => ({}))
5555
const json = renderJSON(
5656
jsx(
57-
ThemeUIProvider,
57+
ThemeProvider,
5858
{ theme: outer },
5959
jsx(
60-
ThemeUIProvider,
60+
ThemeProvider,
6161
{ theme },
6262
jsx('div', {
6363
sx: {
@@ -84,7 +84,7 @@ describe('ThemeUIProvider', () => {
8484
expect(() => {
8585
json = renderJSON(
8686
jsx(
87-
ThemeUIProvider,
87+
ThemeProvider,
8888
{ theme },
8989
jsx(
9090
'div',
@@ -114,7 +114,7 @@ describe('ThemeUIProvider', () => {
114114
}
115115
const json = renderJSON(
116116
jsx(
117-
ThemeUIProvider,
117+
ThemeProvider,
118118
{ theme },
119119
jsx('div', {
120120
sx: {
@@ -158,7 +158,7 @@ describe('jsx', () => {
158158
test('css prop accepts functions', () => {
159159
const json = renderJSON(
160160
jsx(
161-
ThemeUIProvider,
161+
ThemeProvider,
162162
{
163163
theme: {
164164
colors: {
@@ -199,7 +199,7 @@ describe('jsx', () => {
199199
test('sx prop supports dot notation', () => {
200200
const json = renderJSON(
201201
jsx(
202-
ThemeUIProvider,
202+
ThemeProvider,
203203
{
204204
theme: {
205205
config: {
@@ -348,15 +348,15 @@ describe('useThemeUI', () => {
348348
return null
349349
}
350350
renderJSON(
351-
<ThemeUIProvider
351+
<ThemeProvider
352352
theme={{
353353
colors: {
354354
text: 'tomato',
355355
},
356356
}}
357357
>
358358
<GetContext />
359-
</ThemeUIProvider>
359+
</ThemeProvider>
360360
)
361361
expect(context).toBeTruthy()
362362
expect(context?.theme.colors?.text).toBe('tomato')

packages/theme-provider/test/index.tsx

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,24 @@ import { render, cleanup, fireEvent } from '@testing-library/react'
88
import { matchers } from '@emotion/jest'
99
import { renderJSON } from '@theme-ui/test-utils'
1010

11-
import { ThemeProvider } from '../src'
11+
import { ThemeUIProvider } from '../src'
1212

1313
expect.extend(matchers)
1414

1515
afterEach(cleanup)
1616

1717
test('renders', () => {
1818
const json = renderJSON(
19-
<ThemeProvider theme={{}}>
19+
<ThemeUIProvider theme={{}}>
2020
<h1>Hello</h1>
21-
</ThemeProvider>
21+
</ThemeUIProvider>
2222
)
2323
expect(json).toMatchSnapshot()
2424
})
2525

2626
test('renders with theme', () => {
2727
const json = renderJSON(
28-
<ThemeProvider
28+
<ThemeUIProvider
2929
theme={{
3030
config: {
3131
useCustomProperties: false,
@@ -38,14 +38,14 @@ test('renders with theme', () => {
3838
}}
3939
>
4040
<h1 sx={{ color: 'primary' }}>Hello</h1>
41-
</ThemeProvider>
41+
</ThemeUIProvider>
4242
)
4343
expect(json).toHaveStyleRule('color', 'tomato')
4444
})
4545

4646
test('renders global styles', () => {
4747
const root = render(
48-
<ThemeProvider
48+
<ThemeUIProvider
4949
theme={{
5050
fonts: {
5151
body: 'Georgia,serif',
@@ -66,7 +66,7 @@ test('renders global styles', () => {
6666
}}
6767
>
6868
<h1>Hello</h1>
69-
</ThemeProvider>
69+
</ThemeUIProvider>
7070
)
7171

7272
const style = window.getComputedStyle(root.baseElement.parentElement!)
@@ -77,19 +77,19 @@ test('renders global styles', () => {
7777

7878
test('resets body margin', () => {
7979
const root = render(
80-
<ThemeProvider theme={{}}>
80+
<ThemeUIProvider theme={{}}>
8181
<h1>Hello</h1>
82-
</ThemeProvider>
82+
</ThemeUIProvider>
8383
)
8484
const style = window.getComputedStyle(root.baseElement)
8585
expect(style.margin).toBe('0px')
8686
})
8787

8888
test('does not render invalid global styles', () => {
8989
const root = render(
90-
<ThemeProvider theme={{}}>
90+
<ThemeUIProvider theme={{}}>
9191
<h1>Hello</h1>
92-
</ThemeProvider>
92+
</ThemeUIProvider>
9393
)
9494
const style = window.getComputedStyle(root.baseElement.parentElement!)
9595
expect(style.fontFamily).toBe('')
@@ -99,7 +99,7 @@ test('does not render invalid global styles', () => {
9999

100100
test('does not render global styles', () => {
101101
const root = render(
102-
<ThemeProvider
102+
<ThemeUIProvider
103103
theme={{
104104
config: {
105105
useRootStyles: false,
@@ -121,7 +121,7 @@ test('does not render global styles', () => {
121121
}}
122122
>
123123
<h1>Hello</h1>
124-
</ThemeProvider>
124+
</ThemeUIProvider>
125125
)
126126
const style = window.getComputedStyle(root.baseElement)
127127
expect(style.fontFamily).toBe('')
@@ -131,9 +131,9 @@ test('does not render global styles', () => {
131131

132132
test('adds box-sizing: border-box', () => {
133133
const root = render(
134-
<ThemeProvider theme={{}}>
134+
<ThemeUIProvider theme={{}}>
135135
<h1>Hello</h1>
136-
</ThemeProvider>
136+
</ThemeUIProvider>
137137
)
138138
const style = window.getComputedStyle(root.baseElement)
139139
expect(style.boxSizing).toBe('border-box')
@@ -145,15 +145,15 @@ test('does not add box-sizing: border-box', () => {
145145
)
146146
styles.forEach((style) => (style.innerHTML = ''))
147147
const root = render(
148-
<ThemeProvider
148+
<ThemeUIProvider
149149
theme={{
150150
config: {
151151
useBorderBox: false,
152152
},
153153
}}
154154
>
155155
<h1>Hello</h1>
156-
</ThemeProvider>
156+
</ThemeUIProvider>
157157
)
158158
const style = window.getComputedStyle(root.baseElement)
159159
expect(style.boxSizing).toBe('')
@@ -169,7 +169,7 @@ test('updates CSS Custom Properties on root element', async () => {
169169
}
170170

171171
const root = render(
172-
<ThemeProvider
172+
<ThemeUIProvider
173173
theme={{
174174
config: {
175175
// useCustomProperties defaults to `true`
@@ -183,7 +183,7 @@ test('updates CSS Custom Properties on root element', async () => {
183183
}}
184184
>
185185
<DarkModeButton />
186-
</ThemeProvider>
186+
</ThemeUIProvider>
187187
)
188188

189189
const html = root.baseElement.parentElement!

packages/theme-ui/test/color-modes.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ test('dot notation works with color modes and custom properties', () => {
476476
sx={{
477477
color: 'header.title',
478478
}}
479-
onClick={(e) => {
479+
onClick={() => {
480480
setMode('dark')
481481
}}
482482
children="test"

packages/theme-ui/test/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ test('warns when multiple versions of emotion are installed', () => {
5454
test('warns deprecated ThemeUIProvider', () => {
5555
const restore = mockConsole()
5656
render(
57-
<DeprecatedThemeProvider>
57+
<DeprecatedThemeProvider theme={{}}>
5858
<div />
5959
</DeprecatedThemeProvider>
6060
)

packages/typography/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ import wordpress2016 from 'typography-theme-wordpress-2016'
1010
const theme = toTheme(wordpress2016)
1111

1212
export default (props) => (
13-
<ThemeProvider theme={theme}>{props.children}</ThemeProvider>
13+
<ThemeUIProvider theme={theme}>{props.children}</ThemeUIProvider>
1414
)
1515
```

0 commit comments

Comments
 (0)