Skip to content

Commit

Permalink
fix lint and test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
gabiayako committed Nov 8, 2024
1 parent d961b47 commit c3cc085
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { render, screen } from '@testing-library/react';
import { LogoProvider, useLogo } from '../LogoProvider';

const LogoConsumer = () => {
const logo = useLogo();
return <div>{logo}</div>;
};

describe('LogoProvider', () => {
it('renders CRN logo when appName is CRN', async () => {
render(
<LogoProvider appName="CRN">
<LogoConsumer />
</LogoProvider>,
);

expect(screen.getByText('Loading...')).toBeInTheDocument();

const crnLogo = await screen.findByTitle('CRN Logo');
expect(crnLogo).toBeInTheDocument();
});

it('renders GP2 logo when appName is GP2', async () => {
render(
<LogoProvider appName="GP2">
<LogoConsumer />
</LogoProvider>,
);

expect(screen.getByText('Loading...')).toBeInTheDocument();

const gp2Logo = await screen.findByTitle('GP2 Logo');
expect(gp2Logo).toBeInTheDocument();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ describe('CookiesModal', () => {
);

await act(async () => {
await new Promise((resolve) => setTimeout(resolve, 0));
await new Promise((resolve) => {
setTimeout(resolve, 0);
});
});

return view;
Expand Down

0 comments on commit c3cc085

Please sign in to comment.