1- import { userEvent } from '@testing-library/user-event'
21import { render , screen } from '@testing-library/react'
3- import { createRef } from 'react'
42import { describe , expect , test } from 'vitest'
53import {
64 ActionList ,
7- ActionMenu ,
85 Box ,
96 Breadcrumbs ,
107 Button ,
11- CounterLabel ,
128 Dialog ,
139 Flash ,
1410 FormControl ,
@@ -18,12 +14,10 @@ import {
1814 Label ,
1915 Link ,
2016 LinkButton ,
21- Overlay ,
2217 SegmentedControl ,
2318 Spinner ,
2419 Text ,
2520 TextInput ,
26- ThemeProvider ,
2721 Timeline ,
2822 Token ,
2923 Tooltip ,
@@ -38,24 +32,6 @@ describe('@primer/react', () => {
3832 expect ( screen . getByTestId ( 'component' ) ) . toHaveAttribute ( 'data-variant' , 'inset' )
3933 } )
4034
41- test ( 'ActionMenu.Overlay supports `sx` prop' , async ( ) => {
42- const user = userEvent . setup ( )
43- render (
44- < ThemeProvider >
45- < ActionMenu >
46- < ActionMenu . Button > test</ ActionMenu . Button >
47- < ActionMenu . Overlay data-testid = "component" sx = { { background : 'red' } } >
48- test
49- </ ActionMenu . Overlay >
50- </ ActionMenu >
51- </ ThemeProvider > ,
52- )
53-
54- await user . click ( screen . getByText ( 'test' ) )
55-
56- expect ( window . getComputedStyle ( screen . getByTestId ( 'component' ) ) . backgroundColor ) . toBe ( 'rgb(255, 0, 0)' )
57- } )
58-
5935 test ( 'Box supports `sx` prop' , ( ) => {
6036 render ( < Box as = "div" data-testid = "component" sx = { { background : 'red' } } /> )
6137 expect ( window . getComputedStyle ( screen . getByTestId ( 'component' ) ) . backgroundColor ) . toBe ( 'rgb(255, 0, 0)' )
@@ -78,11 +54,6 @@ describe('@primer/react', () => {
7854 expect ( screen . getByTestId ( 'component' ) ) . toHaveAttribute ( 'data-size' , 'medium' )
7955 } )
8056
81- test ( 'CounterLabel supports `sx` prop' , ( ) => {
82- render ( < CounterLabel data-testid = "component" sx = { { background : 'red' } } /> )
83- expect ( window . getComputedStyle ( screen . getByTestId ( 'component' ) ) . backgroundColor ) . toBe ( 'rgb(255, 0, 0)' )
84- } )
85-
8657 test ( 'Dialog supports `sx` prop' , ( ) => {
8758 render ( < Dialog data-testid = "component" sx = { { background : 'red' } } onClose = { ( ) => { } } /> )
8859 expect ( window . getComputedStyle ( screen . getByRole ( 'dialog' ) ) . backgroundColor ) . toBe ( 'rgb(255, 0, 0)' )
@@ -177,25 +148,6 @@ describe('@primer/react', () => {
177148 expect ( screen . getByTestId ( 'component' ) ) . toHaveAttribute ( 'icon' )
178149 } )
179150
180- test ( 'Overlay supports `sx` prop' , ( ) => {
181- const ref = createRef < HTMLElement > ( )
182- render (
183- < ThemeProvider >
184- < Overlay
185- as = "div"
186- data-testid = "component"
187- sx = { { background : 'red' } }
188- onClickOutside = { ( ) => { } }
189- onEscape = { ( ) => { } }
190- returnFocusRef = { ref }
191- role = "dialog"
192- />
193- </ ThemeProvider > ,
194- )
195- expect ( window . getComputedStyle ( screen . getByTestId ( 'component' ) ) . backgroundColor ) . toBe ( 'rgb(255, 0, 0)' )
196- expect ( screen . getByTestId ( 'component' ) ) . toHaveAttribute ( 'role' , 'dialog' )
197- } )
198-
199151 test ( 'SegmentedControl supports `sx` prop' , ( ) => {
200152 render ( < SegmentedControl data-testid = "component" sx = { { background : 'red' } } /> )
201153 expect ( window . getComputedStyle ( screen . getByTestId ( 'component' ) ) . backgroundColor ) . toBe ( 'rgb(255, 0, 0)' )
0 commit comments