3
3
import { describe , expect , test } from "vitest" ;
4
4
5
5
import { BUTTON_COLOR , BUTTON_SIZE } from "../../../constants/button" ;
6
+ import { BUTTON_SIZE_STYLE } from "../config" ;
6
7
7
8
import { getResponsiveStyleVariables } from "./responsive" ;
8
9
9
10
// use the story books and console log the values to create the output, using 1 size for now for testing
10
- const controlResponsiveStyleForMedium = {
11
- style : {
12
- defaultWidth : 250 ,
13
- defaultHeight : 35 ,
14
- minWidth : 200 ,
15
- maxWidth : 300 ,
16
- minHeight : 35 ,
17
- maxHeight : 55 ,
18
- } ,
11
+ const expectedLegacyResponsiveStylesMedium = {
12
+ style : BUTTON_SIZE_STYLE [ BUTTON_SIZE . MEDIUM ] ,
19
13
buttonHeight : 35 ,
20
14
minDualWidth : 300 ,
21
15
textPercPercentage : 36 ,
@@ -24,15 +18,8 @@ const controlResponsiveStyleForMedium = {
24
18
pillBorderRadius : 18 ,
25
19
} ;
26
20
27
- const rebrandStylesVariablesForMedium = {
28
- style : {
29
- defaultWidth : 250 ,
30
- defaultHeight : 35 ,
31
- minWidth : 200 ,
32
- maxWidth : 300 ,
33
- minHeight : 35 ,
34
- maxHeight : 55 ,
35
- } ,
21
+ const expectedRebrandedResponsiveStylesMedium = {
22
+ style : BUTTON_SIZE_STYLE [ BUTTON_SIZE . MEDIUM ] ,
36
23
buttonHeight : 35 ,
37
24
minDualWidth : 300 ,
38
25
textPercPercentage : 36 ,
@@ -54,12 +41,14 @@ describe("test responsive styles", () => {
54
41
} ,
55
42
} ;
56
43
57
- const value = getResponsiveStyleVariables ( {
44
+ const responsiveStyleVariables = getResponsiveStyleVariables ( {
58
45
experiment,
59
46
fundingEligibility,
60
47
size : BUTTON_SIZE . MEDIUM ,
61
48
} ) ;
62
- expect ( value ) . toEqual ( controlResponsiveStyleForMedium ) ;
49
+ expect ( responsiveStyleVariables ) . toEqual (
50
+ expectedLegacyResponsiveStylesMedium
51
+ ) ;
63
52
} ) ;
64
53
65
54
test ( "should return rebrand responsive styles" , ( ) => {
@@ -74,11 +63,13 @@ describe("test responsive styles", () => {
74
63
} ,
75
64
} ;
76
65
77
- const value = getResponsiveStyleVariables ( {
66
+ const responsiveStyleVariables = getResponsiveStyleVariables ( {
78
67
experiment,
79
68
fundingEligibility,
80
69
size : BUTTON_SIZE . MEDIUM ,
81
70
} ) ;
82
- expect ( value ) . toEqual ( rebrandStylesVariablesForMedium ) ;
71
+ expect ( responsiveStyleVariables ) . toEqual (
72
+ expectedRebrandedResponsiveStylesMedium
73
+ ) ;
83
74
} ) ;
84
75
} ) ;
0 commit comments