import { h } from 'preact';
import { render } from '@testing-library/preact';
import { axe } from 'jest-axe';
import ChannelButton from '../components/channelButton';
const getChannel = () => {
return {
channel_name: 'test',
channel_color: '#00FFFF',
channel_type: 'invite_only',
channel_modified_slug: '@test34',
id: 34,
chat_channel_id: 23,
status: 'active',
};
};
describe('', () => {
it('should have no a11y violations', async () => {
const { container } = render();
const results = await axe(container);
expect(results).toHaveNoViolations();
});
it('should render', () => {
const { getByText } = render();
const button = getByText('test');
expect(button.dataset.channelSlug).toEqual('@test34');
expect(button.dataset.channelId).toEqual('23');
expect(button.dataset.channelStatus).toEqual('active');
expect(button.dataset.channelName).toEqual('test');
expect(button.dataset.content).toEqual('sidecar-channel-request');
});
});