You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
744 B
32 lines
744 B
import React from 'react'; |
|
import { AppRootProps, PluginType } from '@grafana/data'; |
|
import { render, screen } from '@testing-library/react'; |
|
import { App } from './App'; |
|
|
|
describe('Components/App', () => { |
|
let props: AppRootProps; |
|
|
|
beforeEach(() => { |
|
jest.resetAllMocks(); |
|
|
|
props = { |
|
basename: 'a/sample-app', |
|
meta: { |
|
id: 'sample-app', |
|
name: 'Sample App', |
|
type: PluginType.app, |
|
enabled: true, |
|
jsonData: {}, |
|
}, |
|
query: {}, |
|
path: '', |
|
onNavChanged: jest.fn(), |
|
} as unknown as AppRootProps; |
|
}); |
|
|
|
test('renders without an error"', () => { |
|
render(<App {...props} />); |
|
|
|
expect(screen.queryByText(/Hello Grafana!/i)).toBeInTheDocument(); |
|
}); |
|
});
|
|
|