Skip to content

Commit 6a48756

Browse files
author
Hai-Yen Nguyen
committed
updated variable names
1 parent a83bc4d commit 6a48756

File tree

1 file changed

+13
-22
lines changed

1 file changed

+13
-22
lines changed

Diff for: src/ui/buttons/styles/responsive.test.js

+13-22
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,13 @@
33
import { describe, expect, test } from "vitest";
44

55
import { BUTTON_COLOR, BUTTON_SIZE } from "../../../constants/button";
6+
import { BUTTON_SIZE_STYLE } from "../config";
67

78
import { getResponsiveStyleVariables } from "./responsive";
89

910
// 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],
1913
buttonHeight: 35,
2014
minDualWidth: 300,
2115
textPercPercentage: 36,
@@ -24,15 +18,8 @@ const controlResponsiveStyleForMedium = {
2418
pillBorderRadius: 18,
2519
};
2620

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],
3623
buttonHeight: 35,
3724
minDualWidth: 300,
3825
textPercPercentage: 36,
@@ -54,12 +41,14 @@ describe("test responsive styles", () => {
5441
},
5542
};
5643

57-
const value = getResponsiveStyleVariables({
44+
const responsiveStyleVariables = getResponsiveStyleVariables({
5845
experiment,
5946
fundingEligibility,
6047
size: BUTTON_SIZE.MEDIUM,
6148
});
62-
expect(value).toEqual(controlResponsiveStyleForMedium);
49+
expect(responsiveStyleVariables).toEqual(
50+
expectedLegacyResponsiveStylesMedium
51+
);
6352
});
6453

6554
test("should return rebrand responsive styles", () => {
@@ -74,11 +63,13 @@ describe("test responsive styles", () => {
7463
},
7564
};
7665

77-
const value = getResponsiveStyleVariables({
66+
const responsiveStyleVariables = getResponsiveStyleVariables({
7867
experiment,
7968
fundingEligibility,
8069
size: BUTTON_SIZE.MEDIUM,
8170
});
82-
expect(value).toEqual(rebrandStylesVariablesForMedium);
71+
expect(responsiveStyleVariables).toEqual(
72+
expectedRebrandedResponsiveStylesMedium
73+
);
8374
});
8475
});

0 commit comments

Comments
 (0)