import React from 'react';
import { render } from '@testing-library/react';
import { IntlProvider } from 'react-intl';
import { N200 } from '@atlaskit/theme/colors';
import { messages } from './messages';
import CaptionPlaceholder from './index';
const renderWithIntl = (component: React.ReactNode) => {
return render({component});
};
const onClick = () => {};
describe('CaptionComponent', () => {
it('should show a placeholder by default', () => {
const { getByText } = renderWithIntl(
,
);
expect(getByText(messages.placeholder.defaultMessage)).not.toBeNull();
});
it('should have the placeholder colour as N200', () => {
const { container } = renderWithIntl(
,
);
expect(container.firstChild).toHaveStyle(`color: ${N200}`);
});
it('placeholder should be centered', () => {
const { container } = renderWithIntl(
,
);
expect(container.firstChild).toHaveStyle(`text-align: center`);
});
});