@@ -40,13 +40,13 @@ describe('functional tests', () => {
4040 } )
4141
4242 afterEach ( ( ) => {
43- styled . mountSheet ( ) . detach ( )
43+ styled . sheet . detach ( )
4444 } )
4545
4646 it ( 'should update props and unmount' , ( ) => {
4747 const App = CreateApp ( styled )
4848 const wrapper = mount ( < App /> )
49- const sheet = styled . mountSheet ( )
49+ const { sheet} = styled
5050
5151 assertSheet ( sheet )
5252 wrapper . setProps ( { margin : 20 } )
@@ -86,7 +86,7 @@ describe('functional tests', () => {
8686 )
8787
8888 const wrapper = mount ( < App /> )
89- const sheet = styled . mountSheet ( )
89+ const { sheet } = styled
9090
9191 assertSheet ( sheet )
9292 wrapper . setProps ( { primary : true } )
@@ -100,7 +100,7 @@ describe('functional tests', () => {
100100 } )
101101
102102 const wrapper = mount ( < Button /> )
103- const sheet = styled . mountSheet ( )
103+ const { sheet} = styled
104104
105105 assertSheet ( sheet )
106106 wrapper
@@ -110,4 +110,25 @@ describe('functional tests', () => {
110110 assertSheet ( sheet )
111111 wrapper . unmount ( )
112112 } )
113+
114+ it ( 'should update dynamic props for conditional rules' , ( ) => {
115+ const Button = styled ( 'button' ) ( {
116+ padding : props => ( props . spaced ? 10 : 0 ) ,
117+
118+ '@media screen' : {
119+ '& .button' : {
120+ margin : props => ( props . spaced ? 10 : 0 )
121+ }
122+ }
123+ } )
124+
125+ const wrapper = mount ( < Button spaced /> )
126+ const { sheet} = styled
127+
128+ assertSheet ( sheet )
129+ wrapper . setProps ( { spaced : false } )
130+ assertSheet ( sheet )
131+
132+ wrapper . unmount ( )
133+ } )
113134} )
0 commit comments