diff --git a/.betterer.results b/.betterer.results index 2245d8d5880..3e95eafec50 100644 --- a/.betterer.results +++ b/.betterer.results @@ -11,9 +11,6 @@ exports[`no enzyme tests`] = { "packages/grafana-ui/src/components/BigValue/BigValue.test.tsx:261212211": [ [1, 19, 13, "RegExp match", "2409514259"] ], - "packages/grafana-ui/src/components/CallToActionCard/CallToActionCard.test.tsx:2771878691": [ - [1, 18, 13, "RegExp match", "2409514259"] - ], "packages/grafana-ui/src/components/ColorPicker/NamedColorsPalette.test.tsx:1355456933": [ [1, 31, 13, "RegExp match", "2409514259"] ], diff --git a/packages/grafana-ui/src/components/CallToActionCard/CallToActionCard.test.tsx b/packages/grafana-ui/src/components/CallToActionCard/CallToActionCard.test.tsx index 633902d32df..1e2a72d8f81 100644 --- a/packages/grafana-ui/src/components/CallToActionCard/CallToActionCard.test.tsx +++ b/packages/grafana-ui/src/components/CallToActionCard/CallToActionCard.test.tsx @@ -1,33 +1,39 @@ import React from 'react'; -import { render } from 'enzyme'; +import { render, screen } from '@testing-library/react'; import { CallToActionCard } from './CallToActionCard'; +import { expect } from '../../../../../public/test/lib/common'; describe('CallToActionCard', () => { describe('rendering', () => { - it('when no message and footer provided', () => { - const tree = render(Click me} />); - expect(tree).toMatchSnapshot(); + it('should render callToActionElement', () => { + render(Click me} />); + expect(screen.getByRole('link', { name: 'Click me' })).toBeInTheDocument(); }); - it('when message and no footer provided', () => { - const tree = render( - Click me} - /> + it('should render message when provided', () => { + render( + Click me} /> ); - expect(tree).toMatchSnapshot(); + expect(screen.getByText('Click button below')).toBeInTheDocument(); }); - it('when message and footer provided', () => { - const tree = render( + it('should render footer when provided', () => { + render( + Click me} /> + ); + expect(screen.getByText('footer content')).toBeInTheDocument(); + }); + + it('should render both message and footer when provided', () => { + render( Click me} /> ); - expect(tree).toMatchSnapshot(); + expect(screen.getByText('Click button below')).toBeInTheDocument(); + expect(screen.getByText('footer content')).toBeInTheDocument(); }); }); }); diff --git a/packages/grafana-ui/src/components/CallToActionCard/__snapshots__/CallToActionCard.test.tsx.snap b/packages/grafana-ui/src/components/CallToActionCard/__snapshots__/CallToActionCard.test.tsx.snap deleted file mode 100644 index 511fd516da3..00000000000 --- a/packages/grafana-ui/src/components/CallToActionCard/__snapshots__/CallToActionCard.test.tsx.snap +++ /dev/null @@ -1,52 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CallToActionCard rendering when message and footer provided 1`] = ` -
-
- Click button bellow -
- - Click me - -
- footer content -
-
-`; - -exports[`CallToActionCard rendering when message and no footer provided 1`] = ` -
-
- Click button bellow -
- - Click me - -
-`; - -exports[`CallToActionCard rendering when no message and footer provided 1`] = ` - -`;