You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/02/17 17:44:31 UTC
[GitHub] [superset] etr2460 commented on a change in pull request #13179: test: Adding test and storybook to "Loading" component.
etr2460 commented on a change in pull request #13179:
URL: https://github.com/apache/superset/pull/13179#discussion_r577813467
##########
File path: superset-frontend/src/components/Loading/index.tsx
##########
@@ -41,12 +42,16 @@ const LoaderImg = styled.img`
transform: translate(-50%, -50%);
}
`;
-export default function Loading({ position = 'floating' }: Props) {
+export default function Loading({
+ position = 'floating',
+ image = '/static/assets/images/loading.gif',
+}: Props) {
return (
<LoaderImg
className={`loading ${position}`}
alt="Loading..."
- src="/static/assets/images/loading.gif"
+ src={image}
+ data-test-id="loading"
Review comment:
perhaps instead of setting a test id here, we should add the appropriate aria labels, both for a11y and so that RTL can see them.
I think `aria-busy=true` and `aria-label=loading` would be pretty standard, and then you should be able to select it with RTL either using the new aria labels, or with `getByAltText`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org