Skip to content

Commit

Permalink
Test(web-react): Fix typo in data-testid attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
literat committed Dec 19, 2024
1 parent 3b281f4 commit fa7e713
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('Card', () => {
});

it('should render custom element', () => {
render(<Card elementType="section" data-testId="test" />);
render(<Card elementType="section" data-testid="test" />);

expect(screen.getByTestId('test')).toContainHTML('section');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ describe('CardArtwork', () => {
alignmentXPropsTest(CardArtwork, 'CardArtwork');

it('should render artwork card component and have default class name', () => {
render(<CardArtwork data-testId="test" />);
render(<CardArtwork data-testid="test" />);

expect(screen.getByTestId('test')).toHaveClass('CardArtwork');
});

it('should render text children', () => {
render(<CardArtwork data-testId="test">Hello World</CardArtwork>);
render(<CardArtwork data-testid="test">Hello World</CardArtwork>);

expect(screen.getByTestId('test')).toHaveTextContent('Hello World');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ describe('CardEyebrow', () => {
restPropsTest(CardEyebrow, '.CardEyebrow');

it('should render eyebrow card component and have default class name', () => {
render(<CardEyebrow data-testId="test" />);
render(<CardEyebrow data-testid="test" />);

expect(screen.getByTestId('test')).toHaveClass('CardEyebrow');
});

it('should render text children', () => {
render(<CardEyebrow data-testId="test">Hello World</CardEyebrow>);
render(<CardEyebrow data-testid="test">Hello World</CardEyebrow>);

expect(screen.getByTestId('test')).toHaveTextContent('Hello World');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ describe('CardLogo', () => {
restPropsTest(CardLogo, '.CardLogo');

it('should render logo card component and have default class name', () => {
render(<CardLogo data-testId="test" />);
render(<CardLogo data-testid="test" />);

expect(screen.getByTestId('test')).toHaveClass('CardLogo');
});

it('should render text children', () => {
render(<CardLogo data-testId="test">Hello World</CardLogo>);
render(<CardLogo data-testid="test">Hello World</CardLogo>);

expect(screen.getByTestId('test')).toHaveTextContent('Hello World');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ describe('CardMedia', () => {
sizePropsTest(CardMedia);

it('should render media card media component and have default class names', () => {
render(<CardMedia data-testId="test" />);
render(<CardMedia data-testid="test" />);

expect(screen.getByTestId('test')).toHaveClass('CardMedia CardMedia--auto');
});

it('should render auto size', () => {
render(<CardMedia size="auto" data-testId="test" />);
render(<CardMedia size="auto" data-testid="test" />);

expect(screen.getByTestId('test')).toHaveClass('CardMedia--auto');
});

it('should fill the height', () => {
render(<CardMedia hasFilledHeight data-testId="test" />);
render(<CardMedia hasFilledHeight data-testid="test" />);

expect(screen.getByTestId('test')).toHaveClass('CardMedia--filledHeight');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,25 @@ describe('CardTitle', () => {
restPropsTest(CardTitle, '.CardTitle');

it('should render title card component and have default class names', () => {
render(<CardTitle data-testId="test" />);
render(<CardTitle data-testid="test" />);

expect(screen.getByTestId('test')).toHaveClass('CardTitle CardTitle--heading');
});

it('should render custom element', () => {
render(<CardTitle elementType="h1" data-testId="test" />);
render(<CardTitle elementType="h1" data-testid="test" />);

expect(screen.getByTestId('test')).toContainHTML('h1');
});

it('should render as heading', () => {
render(<CardTitle isHeading data-testId="test" />);
render(<CardTitle isHeading data-testid="test" />);

expect(screen.getByTestId('test')).toHaveClass('CardTitle--heading');
});

it('should render text children', () => {
render(<CardTitle data-testId="test">Hello World</CardTitle>);
render(<CardTitle data-testid="test">Hello World</CardTitle>);

expect(screen.getByTestId('test')).toHaveTextContent('Hello World');
});
Expand Down

0 comments on commit fa7e713

Please sign in to comment.