add testing lib jest dom types, fixes #311

This commit is contained in:
nikek
2020-03-18 21:35:38 +01:00
parent d87c80743e
commit 1db34ba2a3
3 changed files with 23 additions and 2 deletions
@@ -11,7 +11,8 @@
"test": "backstage-cli test"
},
"devDependencies": {
"@spotify-backstage/cli": "^{{version}}"
"@spotify-backstage/cli": "^{{version}}",
"@types/testing-library__jest-dom": "5.0.2"
},
"dependencies": {
"@material-ui/lab": "4.0.0-alpha.45"
@@ -17,10 +17,15 @@
import React from 'react';
import { render } from '@testing-library/react';
import ExampleComponent from './ExampleComponent';
import { ThemeProvider } from '@material-ui/core';
import { BackstageTheme } from '@spotify-backstage/core';
describe('ExampleComponent', () => {
it('should render', () => {
const rendered = render(<ExampleComponent />);
const rendered = render(
<ThemeProvider theme={BackstageTheme}>
<ExampleComponent />
</ThemeProvider>,);
expect(rendered.getByText('Welcome to {{ id }}!')).toBeInTheDocument();
});
});