mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
26 lines
688 B
TypeScript
26 lines
688 B
TypeScript
import React from 'react';
|
|
import { render, screen } from 'test/test-utils';
|
|
|
|
import { AuthDrawerUnconnected, Props } from './AuthDrawer';
|
|
|
|
const defaultProps: Props = {
|
|
onClose: jest.fn(),
|
|
allowInsecureEmail: false,
|
|
loadSettings: jest.fn(),
|
|
saveSettings: jest.fn(),
|
|
};
|
|
|
|
async function getTestContext(overrides: Partial<Props> = {}) {
|
|
jest.clearAllMocks();
|
|
|
|
const props = { ...defaultProps, ...overrides };
|
|
const { rerender } = render(<AuthDrawerUnconnected {...props} />);
|
|
|
|
return { rerender, props };
|
|
}
|
|
|
|
it('should render with default props', async () => {
|
|
await getTestContext({});
|
|
expect(screen.getByText(/Enable insecure email lookup/i)).toBeInTheDocument();
|
|
});
|