Add example with mantine tests package

This commit is contained in:
Vitaly Rtishchev
2023-11-19 19:07:26 +04:00
parent 893ad91d71
commit 8e798f84d1
5 changed files with 66 additions and 18 deletions
+3 -1
View File
@@ -1,7 +1,9 @@
import { render, screen } from '@/test-utils';
import { render, screen, tests } from '@/test-utils';
import { Welcome } from './Welcome';
describe('Welcome component', () => {
tests.itSupportsClassName({ component: Welcome, props: {} });
it('has correct Next.js theming section link', () => {
render(<Welcome />);
expect(screen.getByText('this guide')).toHaveAttribute(
+3 -3
View File
@@ -1,9 +1,9 @@
import { Title, Text, Anchor } from '@mantine/core';
import classes from './Welcome.module.css';
export function Welcome() {
export function Welcome(props: React.ComponentPropsWithoutRef<'div'>) {
return (
<>
<div {...props}>
<Title className={classes.title} ta="center" mt={100}>
Welcome to{' '}
<Text inherit variant="gradient" component="span" gradient={{ from: 'pink', to: 'yellow' }}>
@@ -18,6 +18,6 @@ export function Welcome() {
</Anchor>
. To get started edit page.tsx file.
</Text>
</>
</div>
);
}