Skip to content

Commit 08e48e0

Browse files
committed
test: use snapshot test
1 parent 45cdfc0 commit 08e48e0

File tree

2 files changed

+28
-23
lines changed

2 files changed

+28
-23
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`getTabStyles transforms tab styles to CSS properties 1`] = `
4+
{
5+
"--awsui-style-background-active-cdnyga": "#bfdbfe",
6+
"--awsui-style-background-default-cdnyga": "#dbeafe",
7+
"--awsui-style-background-disabled-cdnyga": "#f3f4f6",
8+
"--awsui-style-background-hover-cdnyga": "#eff6ff",
9+
"--awsui-style-border-color-active-cdnyga": "#1d4ed8",
10+
"--awsui-style-border-color-default-cdnyga": "#3b82f6",
11+
"--awsui-style-border-color-disabled-cdnyga": "#93c5fd",
12+
"--awsui-style-border-color-hover-cdnyga": "#2563eb",
13+
"--awsui-style-color-active-cdnyga": "#1e3a8a",
14+
"--awsui-style-color-default-cdnyga": "#1e40af",
15+
"--awsui-style-color-disabled-cdnyga": "#93c5fd",
16+
"--awsui-style-color-hover-cdnyga": "#1e40af",
17+
"--awsui-style-focus-ring-border-color-cdnyga": "#3b82f6",
18+
"--awsui-style-focus-ring-border-radius-cdnyga": "4px",
19+
"--awsui-style-focus-ring-border-width-cdnyga": "2px",
20+
"borderRadius": "4px",
21+
"borderWidth": "2px",
22+
"fontSize": "16px",
23+
"fontWeight": "500",
24+
"paddingBlock": "10px",
25+
"paddingInline": "14px",
26+
}
27+
`;

src/tabs/__tests__/styles.test.tsx

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -48,29 +48,7 @@ describe('getTabStyles', () => {
4848
},
4949
};
5050

51-
expect(getTabStyles(tabStyles)).toEqual({
52-
borderRadius: '4px',
53-
borderWidth: '2px',
54-
fontSize: '16px',
55-
fontWeight: '500',
56-
paddingBlock: '10px',
57-
paddingInline: '14px',
58-
[customCssProps.styleBackgroundActive]: '#bfdbfe',
59-
[customCssProps.styleBackgroundDefault]: '#dbeafe',
60-
[customCssProps.styleBackgroundDisabled]: '#f3f4f6',
61-
[customCssProps.styleBackgroundHover]: '#eff6ff',
62-
[customCssProps.styleBorderColorActive]: '#1d4ed8',
63-
[customCssProps.styleBorderColorDefault]: '#3b82f6',
64-
[customCssProps.styleBorderColorDisabled]: '#93c5fd',
65-
[customCssProps.styleBorderColorHover]: '#2563eb',
66-
[customCssProps.styleColorActive]: '#1e3a8a',
67-
[customCssProps.styleColorDefault]: '#1e40af',
68-
[customCssProps.styleColorDisabled]: '#93c5fd',
69-
[customCssProps.styleColorHover]: '#1e40af',
70-
[customCssProps.styleFocusRingBorderColor]: '#3b82f6',
71-
[customCssProps.styleFocusRingBorderRadius]: '4px',
72-
[customCssProps.styleFocusRingBorderWidth]: '2px',
73-
});
51+
expect(getTabStyles(tabStyles)).toMatchSnapshot();
7452
});
7553

7654
test('returns undefined when SYSTEM is not core', async () => {

0 commit comments

Comments
 (0)