convert test to RTL (#48291)

This commit is contained in:
Ashley Harrison 2022-05-03 08:45:50 +01:00 committed by GitHub
parent 7acf5bd7e8
commit d774deab99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 8 deletions

View File

@ -50,9 +50,6 @@ exports[`no enzyme tests`] = {
"packages/grafana-ui/src/components/Typeahead/Typeahead.test.tsx:972524250": [
[0, 17, 13, "RegExp match", "2409514259"]
],
"packages/grafana-ui/src/components/Typeahead/TypeaheadInfo.test.tsx:3512289373": [
[0, 17, 13, "RegExp match", "2409514259"]
],
"packages/grafana-ui/src/slate-plugins/braces.test.tsx:1440546721": [
[0, 19, 13, "RegExp match", "2409514259"]
],

View File

@ -1,4 +1,4 @@
import { mount } from 'enzyme';
import { render, screen } from '@testing-library/react';
import React from 'react';
import { CompletionItem } from '../../types';
@ -6,9 +6,9 @@ import { CompletionItem } from '../../types';
import { TypeaheadInfo } from './TypeaheadInfo';
describe('TypeaheadInfo component', () => {
it('should show documentation as rendered markdown if passed as a markdown', () => {
const item: CompletionItem = { label: 'markdown', documentation: '**bold**' };
const wrapper = mount(<TypeaheadInfo item={item} height={100} />);
expect(wrapper.find('div>div').html()).toMatch('strong');
it('should show documentation as rendered markdown if passed as markdown', () => {
const item: CompletionItem = { label: 'markdown', documentation: '# My heading' };
render(<TypeaheadInfo item={item} height={100} />);
expect(screen.getByRole('heading', { name: 'My heading' })).toBeInTheDocument();
});
});