* Feature 🚀 : Ability to delete messages in chat channels - Sending message ID to frontend - Deleting Message - Use pusher to delete message realtime * Minor Bug 🐞: Show message action only for current user - User can delete or edit their own messages * Test cases added * Bug 🐞: Update message id for receiver Message id was not sent to receiver by pusher * Refactoring🛠: Message controller refactoring * Test Cases📝 : Specs for Delete message added * Feature 🚀 : Ability to edit messages * Test Cases📝 : Specs for Edit message added * Merge conflict resolved * request manager info API * 👨🏼🎨 Design added for requestCenter * integrate request manager with API * remove unused argument * fix request manager card UI * fix request card UI * add request manager button * handle no invitaion UI * fix badge UI * add request specs * add jest specs * remove the presenter * fix code climate issues * fix queries * fix runbocop issues * fix PR suggestions * remove empty lines Co-authored-by: Sarthak Sharma <7lovesharma7@gmail.com>
41 lines
1.1 KiB
JavaScript
41 lines
1.1 KiB
JavaScript
import { h } from 'preact';
|
|
import { render } from '@testing-library/preact';
|
|
import { axe } from 'jest-axe';
|
|
import ChannelRequestSection from '../RequestManager/ChannelRequestSection';
|
|
|
|
const data = {
|
|
channelRequests: [
|
|
{
|
|
name: 'Demo name',
|
|
membership_id: 11,
|
|
user_id: 10,
|
|
role: 'member',
|
|
image: '/image',
|
|
username: 'demousername',
|
|
status: 'joining_request',
|
|
chat_channel_name: 'demo channel',
|
|
},
|
|
],
|
|
};
|
|
|
|
describe('<ChannelRequestSection />', () => {
|
|
it('should have no a11y violations', async () => {
|
|
const { container } = render(
|
|
<ChannelRequestSection channelRequests={data.channelRequests} />,
|
|
);
|
|
const results = await axe(container);
|
|
|
|
expect(results).toHaveNoViolations();
|
|
});
|
|
|
|
it('should render the the component', () => {
|
|
const { getByTestId } = render(
|
|
<ChannelRequestSection channelRequests={data.channelRequests} />,
|
|
);
|
|
|
|
const channelRequestsWrapper = getByTestId('chat-channel-joining-request');
|
|
expect(
|
|
Number(channelRequestsWrapper.dataset.activeCount),
|
|
).toBeGreaterThanOrEqual(1);
|
|
});
|
|
});
|