/** @jsxImportSource @compiled/react */
// This test belongs in @compiled/jest - but can't be placed there due to a circular dependency.
// eslint-disable-next-line import/no-extraneous-dependencies
import { cssMap, styled } from '@compiled/react';
import { render } from '@testing-library/react';
describe('toHaveCompliedCss', () => {
it('should detect styles', () => {
const { getByText } = render(
);
expect(getByText('hello world')).toHaveCompiledCss('--my-kebab-var', 'green');
});
it('should match styles with media', () => {
const { getByText } = render(
hello world
);
const el = getByText('hello world');
expect(el).toHaveCompiledCss('color', 'green');
expect(el).toHaveCompiledCss('color', 'yellow', { media: 'screen' });
// without narrowing to media -> screen
expect(el).not.toHaveCompiledCss('color', 'yellow');
});
it('should match styles with media and target', () => {
const { getByText } = render(
hello world
);
const el = getByText('hello world');
expect(el).toHaveCompiledCss('background-color', 'red', { media: 'screen', target: ':hover' });
});
it('should match styles with media nested inside class', () => {
const { getByText } = render(