return (
<>
- <div
- className={classNames('sw-overflow-hidden', { 'sw-sr-only sw-left-[-10000px]': !loading })}
- >
- <StyledSpinner aria-live="polite" className={className} role="status">
- {loading && <span className="sw-sr-only sw-left-[-10000px]">{ariaLabel}</span>}
- </StyledSpinner>
+ <div className="sw-relative">
+ <div className={classNames('sw-overflow-hidden', { 'sw-sr-only': !loading })}>
+ <StyledSpinner aria-live="polite" className={className} role="status">
+ {loading && <span className="sw-sr-only">{ariaLabel}</span>}
+ </StyledSpinner>
+ </div>
</div>
{!loading && (children ?? (placeholder && <Placeholder className={className} />) ?? null)}
</>
class="emotion-0 emotion-1"
>
<div
- class="sw-overflow-hidden sw-sr-only sw-left-[-10000px]"
+ class="sw-relative"
>
<div
- aria-live="polite"
- class="emotion-2 emotion-3"
- role="status"
- />
+ class="sw-overflow-hidden sw-sr-only"
+ >
+ <div
+ aria-live="polite"
+ class="emotion-2 emotion-3"
+ role="status"
+ />
+ </div>
</div>
<button
type="button"
class="emotion-0 emotion-1"
>
<div
- class="sw-overflow-hidden sw-sr-only sw-left-[-10000px]"
+ class="sw-relative"
>
<div
- aria-live="polite"
- class="emotion-2 emotion-3"
- role="status"
- />
+ class="sw-overflow-hidden sw-sr-only"
+ >
+ <div
+ aria-live="polite"
+ class="emotion-2 emotion-3"
+ role="status"
+ />
+ </div>
</div>
<button
type="button"
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { act, screen, within } from '@testing-library/react';
+import { act, screen, waitFor, within } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import * as React from 'react';
import selectEvent from 'react-select-event';
expect(await ui.sureButton.find()).toBeInTheDocument();
await act(() => user.click(ui.sureButton.get()));
- expect(getTokensList()).toHaveLength(2);
+ await waitFor(() => expect(getTokensList()).toHaveLength(2));
await act(() => user.click(ui.generateButton.get()));
- expect(getTokensList()).toHaveLength(3);
+ await waitFor(() => expect(getTokensList()).toHaveLength(3));
expect(await screen.findByText('users.tokens.new_token_created.test')).toBeInTheDocument();
await user.click(ui.doneButton.get());
data-testid="spinner"
>
<span
- class="sw-sr-only sw-left-[-10000px]"
+ class="sw-sr-only"
>
loading
</span>
data-testid="spinner"
>
<span
- class="sw-sr-only sw-left-[-10000px]"
+ class="sw-sr-only"
>
me
</span>
child
</a>
<div
- class="sw-overflow-hidden"
+ class="sw-overflow-hidden sw-relative"
>
<i
aria-live="polite"
return (
<>
- <div className="sw-overflow-hidden">
+ <div className="sw-overflow-hidden sw-relative">
<i
aria-live="polite"
data-testid="spinner"
'is-loading': loading,
})}
>
- {loading && <span className="sw-sr-only sw-left-[-10000px]">{ariaLabel}</span>}
+ {loading && <span className="sw-sr-only">{ariaLabel}</span>}
</i>
</div>
{!loading && children}