Skip to content

Commit 5eebffe

Browse files
committed
make use of styled-components .attrs extension method to define static attributes on various components that were spreading global defined objects
1 parent dc3baa5 commit 5eebffe

23 files changed

+73
-74
lines changed

__stories__/helpers/components/PackageLink.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const Link = styled.a`
2323
transform: translate3d(0px, 0px, 0px);
2424
2525
:hover {
26-
transform: translate3d(0px, -2px, 0px);
26+
transform: translate3d(0px, -1.5px, 0px);
2727
}
2828
`;
2929

__tests__/IndicatorIcons.test.tsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const createIndicatorIconsProps = () => {
3838

3939
const customIconFn = (props: Partial<IndicatorIconsProps>): ReactNode => {
4040
const { menuOpen, isLoading, isInvalid, isDisabled } = props;
41-
const testIdText = `${menuOpen}_${isLoading}_${isInvalid}_${isDisabled}`;
41+
const testIdText = `${menuOpen}-${isLoading}-${isInvalid}-${isDisabled}`;
4242

4343
return (
4444
<span data-testid={testIdText}>
@@ -115,12 +115,15 @@ test('clear icon can render as a ReactNode', async () => {
115115
});
116116

117117
test('clear icon can render as a callback function with return type of ReactNode - callback accepts forwarded state props from wrapping component.', async () => {
118-
const customIconTestIdText = 'true_false_false_false';
119118
const { props } = createIndicatorIconsProps();
120119
const mergedProps = { ...props, menuOpen: true, clearIcon: customIconFn };
121120
const { getByTestId } = renderIndicatorIcons(mergedProps);
122121

123-
expect(getByTestId(customIconTestIdText)).toBeInTheDocument();
122+
// Build test-id from forwarded state javascript object payload
123+
const { menuOpen, isLoading, isInvalid, isDisabled } = mergedProps;
124+
const forwardedStateId = `${menuOpen}-${isLoading}-${isInvalid}-${isDisabled}`
125+
126+
expect(getByTestId(forwardedStateId)).toBeInTheDocument();
124127
});
125128

126129
test('caret icon can render as a ReactNode', async () => {
@@ -135,10 +138,13 @@ test('caret icon can render as a ReactNode', async () => {
135138
});
136139

137140
test('caret icon can render as a callback function with return type of ReactNode - callback accepts forwarded state props from wrapping component.', async () => {
138-
const customIconTestIdText = 'true_false_false_false';
139141
const { props } = createIndicatorIconsProps();
140142
const mergedProps = { ...props, menuOpen: true, caretIcon: customIconFn };
141143
const { getByTestId } = renderIndicatorIcons(mergedProps);
142144

143-
expect(getByTestId(customIconTestIdText)).toBeInTheDocument();
145+
// Build test-id from forwarded state javascript object payload
146+
const { menuOpen, isLoading, isInvalid, isDisabled } = mergedProps;
147+
const forwardedStateId = `${menuOpen}-${isLoading}-${isInvalid}-${isDisabled}`
148+
149+
expect(getByTestId(forwardedStateId)).toBeInTheDocument();
144150
});

docs/asset-manifest.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
22
"files": {
3-
"main.js": "./main.2b2021dd.iframe.bundle.js",
3+
"main.js": "./main.dc92d9cb.iframe.bundle.js",
44
"runtime~main.js": "./runtime~main.f398e60b.iframe.bundle.js",
5-
"vendors~main.js": "./vendors~main.dacc63da.iframe.bundle.js",
6-
"vendors~main.js.map": "./vendors~main.dacc63da.iframe.bundle.js.map",
5+
"vendors~main.js": "./vendors~main.7e0302cf.iframe.bundle.js",
6+
"vendors~main.js.map": "./vendors~main.7e0302cf.iframe.bundle.js.map",
77
"iframe.html": "./iframe.html",
8-
"vendors~main.dacc63da.iframe.bundle.js.LICENSE.txt": "./vendors~main.dacc63da.iframe.bundle.js.LICENSE.txt"
8+
"vendors~main.7e0302cf.iframe.bundle.js.LICENSE.txt": "./vendors~main.7e0302cf.iframe.bundle.js.LICENSE.txt"
99
},
1010
"entrypoints": [
1111
"runtime~main.f398e60b.iframe.bundle.js",
12-
"vendors~main.dacc63da.iframe.bundle.js",
13-
"main.2b2021dd.iframe.bundle.js"
12+
"vendors~main.7e0302cf.iframe.bundle.js",
13+
"main.dc92d9cb.iframe.bundle.js"
1414
]
1515
}

docs/iframe.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,4 @@
130130

131131

132132

133-
window['FRAMEWORK_OPTIONS'] = {};</script><script src="runtime~main.f398e60b.iframe.bundle.js"></script><script src="vendors~main.dacc63da.iframe.bundle.js"></script><script src="main.2b2021dd.iframe.bundle.js"></script></body></html>
133+
window['FRAMEWORK_OPTIONS'] = {};</script><script src="runtime~main.f398e60b.iframe.bundle.js"></script><script src="vendors~main.7e0302cf.iframe.bundle.js"></script><script src="main.dc92d9cb.iframe.bundle.js"></script></body></html>

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,4 +135,4 @@
135135

136136

137137

138-
window['DOCS_MODE'] = false;</script><script src="runtime~main.0823b7e43ff705590cc9.manager.bundle.js"></script><script src="vendors~main.751039d5a199589f8853.manager.bundle.js"></script><script src="main.f593d086f4784443a29f.manager.bundle.js"></script></body></html>
138+
window['DOCS_MODE'] = false;</script><script src="runtime~main.0823b7e43ff705590cc9.manager.bundle.js"></script><script src="vendors~main.163b9d3809bb608345c7.manager.bundle.js"></script><script src="main.f593d086f4784443a29f.manager.bundle.js"></script></body></html>

docs/main.2b2021dd.iframe.bundle.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/main.dc92d9cb.iframe.bundle.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/vendors~main.163b9d3809bb608345c7.manager.bundle.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/vendors~main.751039d5a199589f8853.manager.bundle.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)