import React from 'react';
import { customRender } from 'test-utils';
import SidebarShopButton from '.';
import {
COLOR_SIDEBAR_SECONDARY_BUTTON_BG,
COLOR_SIDEBAR_SECONDARY_BUTTON_BG_ACTIVE,
} from '../../styles/constants';
describe('', () => {
it('should render correctly', () => {
// FIXME: add test cases for hover and active states
const { container, getByText } = customRender(Children);
const shopButton = container.firstChild;
const children = getByText('Children');
expect(shopButton).toHaveStyle(`
color: #fff;
background-color: ${COLOR_SIDEBAR_SECONDARY_BUTTON_BG};
`);
expect(shopButton).toContainElement(children);
});
it('should allow to pass any props', () => {
const { container } = customRender(
Hello World,
);
expect(container.querySelector('[data-foo="bar"]')).toBeInTheDocument();
});
describe('when passing active', () => {
it('should render correctly', () => {
const { container } = customRender(Hello World);
const shopButton = container.firstChild;
expect(shopButton).toHaveStyle(
`background-color: ${COLOR_SIDEBAR_SECONDARY_BUTTON_BG_ACTIVE}`,
);
});
});
});