@@ -11,10 +11,9 @@ const REVENUE = { long: '$1,659.50', short: '$1.7K' }
1111
1212describe ( 'single value' , ( ) => {
1313 it ( 'renders small value' , async ( ) => {
14- await renderWithTooltip ( < MetricValue { ...valueProps ( 'visitors' , 10 ) } /> )
14+ render ( < MetricValue { ...valueProps ( 'visitors' , 10 ) } /> )
1515
1616 expect ( screen . getByTestId ( 'metric-value' ) ) . toHaveTextContent ( '10' )
17- expect ( screen . getByRole ( 'tooltip' ) ) . toHaveTextContent ( '10' )
1817 } )
1918
2019 it ( 'renders large value' , async ( ) => {
@@ -25,31 +24,28 @@ describe('single value', () => {
2524 } )
2625
2726 it ( 'renders percentages' , async ( ) => {
28- await renderWithTooltip ( < MetricValue { ...valueProps ( 'bounce_rate' , 5.3 ) } /> )
27+ render ( < MetricValue { ...valueProps ( 'bounce_rate' , 5.3 ) } /> )
2928
3029 expect ( screen . getByTestId ( 'metric-value' ) ) . toHaveTextContent ( '5.3%' )
31- expect ( screen . getByRole ( 'tooltip' ) ) . toHaveTextContent ( '5.3%' )
3230 } )
3331
3432 it ( 'renders durations' , async ( ) => {
35- await renderWithTooltip (
33+ render (
3634 < MetricValue { ...valueProps ( 'visit_duration' , 60 ) } />
3735 )
3836
3937 expect ( screen . getByTestId ( 'metric-value' ) ) . toHaveTextContent ( '1m 00s' )
40- expect ( screen . getByRole ( 'tooltip' ) ) . toHaveTextContent ( '1m 00s' )
4138 } )
4239
4340 it ( 'renders with custom formatter' , async ( ) => {
44- await renderWithTooltip (
41+ render (
4542 < MetricValue
4643 { ...valueProps ( 'test_money' , 5.3 ) }
4744 formatter = { ( value ) => `${ value } $` }
4845 />
4946 )
5047
5148 expect ( screen . getByTestId ( 'metric-value' ) ) . toHaveTextContent ( '5.3$' )
52- expect ( screen . getByRole ( 'tooltip' ) ) . toHaveTextContent ( '5.3$' )
5349 } )
5450
5551 it ( 'renders revenue properly' , async ( ) => {
@@ -80,9 +76,8 @@ describe('comparisons', () => {
8076 expect ( screen . getByRole ( 'tooltip' ) ) . toHaveTextContent (
8177 [
8278 '10 visitors' ,
83- '↑ 100%' ,
8479 '01 Aug - 31 Aug' ,
85- 'vs ' ,
80+ '↑ 100% ' ,
8681 '5 visitors' ,
8782 '01 July - 31 July'
8883 ] . join ( '' )
@@ -98,9 +93,8 @@ describe('comparisons', () => {
9893 expect ( screen . getByRole ( 'tooltip' ) ) . toHaveTextContent (
9994 [
10095 '5 visitors' ,
101- '↓ 50%' ,
10296 '01 Aug - 31 Aug' ,
103- 'vs ' ,
97+ '↓ 50% ' ,
10498 '10 visitors' ,
10599 '01 July - 31 July'
106100 ] . join ( '' )
@@ -116,9 +110,8 @@ describe('comparisons', () => {
116110 expect ( screen . getByRole ( 'tooltip' ) ) . toHaveTextContent (
117111 [
118112 '10 visitors' ,
119- '〰 0%' ,
120113 '01 Aug - 31 Aug' ,
121- 'vs ' ,
114+ '0% ' ,
122115 '10 visitors' ,
123116 '01 July - 31 July'
124117 ] . join ( '' )
@@ -136,9 +129,8 @@ describe('comparisons', () => {
136129 expect ( screen . getByRole ( 'tooltip' ) ) . toHaveTextContent (
137130 [
138131 '10 conversions' ,
139- '〰 0%' ,
140132 '01 Aug - 31 Aug' ,
141- 'vs ' ,
133+ '0% ' ,
142134 '10 conversions' ,
143135 '01 July - 31 July'
144136 ] . join ( '' )
@@ -156,9 +148,8 @@ describe('comparisons', () => {
156148 expect ( screen . getByRole ( 'tooltip' ) ) . toHaveTextContent (
157149 [
158150 '10% ' ,
159- '〰 0%' ,
160151 '01 Aug - 31 Aug' ,
161- 'vs ' ,
152+ '0% ' ,
162153 '10% ' ,
163154 '01 July - 31 July'
164155 ] . join ( '' )
@@ -177,9 +168,8 @@ describe('comparisons', () => {
177168 expect ( screen . getByRole ( 'tooltip' ) ) . toHaveTextContent (
178169 [
179170 '10$ test' ,
180- '↑ 100%' ,
181171 '01 Aug - 31 Aug' ,
182- 'vs ' ,
172+ '↑ 100% ' ,
183173 '5$ test' ,
184174 '01 July - 31 July'
185175 ] . join ( '' )
@@ -200,9 +190,8 @@ describe('comparisons', () => {
200190 expect ( screen . getByRole ( 'tooltip' ) ) . toHaveTextContent (
201191 [
202192 '$1,659.50 average_revenue' ,
203- '〰 0%' ,
204193 '01 Aug - 31 Aug' ,
205- 'vs ' ,
194+ '0% ' ,
206195 '$1,659.50 average_revenue' ,
207196 '01 July - 31 July'
208197 ] . join ( '' )
0 commit comments