Skip to content

Commit

Permalink
chore: fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Flitton <[email protected]>
  • Loading branch information
FrankFlitton committed Jun 23, 2023
1 parent a0928ef commit 028d305
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ import { Workflow } from 'models/Workflow/types';
import { projects } from 'mocks/data/projects';
import * as projectApi from 'models/Project/api';
import { MemoryRouter } from 'react-router';
import { QueryClient, QueryClientProvider } from 'react-query';
import { EntityDetails } from '../EntityDetails';

const queryClient = new QueryClient();

jest.mock('models/Project/api');

describe('EntityDetails', () => {
Expand All @@ -27,9 +30,11 @@ describe('EntityDetails', () => {

const renderDetails = (id: ResourceIdentifier) => {
return render(
<MemoryRouter>
<EntityDetails id={id} />
</MemoryRouter>,
<QueryClientProvider client={queryClient}>
<MemoryRouter>
<EntityDetails id={id} />
</MemoryRouter>
</QueryClientProvider>,
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,15 @@ export const UserInformation: React.FC<{}> = () => {
onMouseLeave={handlePopoverClose}
disableFocusRipple
>
<Avatar className={styles.avatar}>{userNameInitial}</Avatar>
<Avatar className={styles.avatar}>
{userNameInitial}
<span className="sr-only">{userName}</span>
</Avatar>
<Popover
open={open}
id="avatar-popover"
anchorEl={anchorEl}
aria-hidden
anchorOrigin={{
vertical: 'bottom',
horizontal: 'left',
Expand Down
3 changes: 3 additions & 0 deletions packages/console/src/components/utils/GlobalStyles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ const GlobalStyles = () => {
body {
overscroll-behavior: none;
}
.sr-only {
display: none;
}
`);
}, []);
return <></>;
Expand Down
2 changes: 1 addition & 1 deletion script/test/jest.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
testPathIgnorePatterns: [
'__stories__',
'.storybook',
'node_modules',
'/node_modules/',
'dist',
'lib',
'build',
Expand Down

0 comments on commit 028d305

Please sign in to comment.