* 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 * 🐞 Channel List bug in mobile view * changes in joining request responses * 🛠 Request Managers Frontend ready * changes in routes for adding and removing remembership * 🚀 New routes implemented for request manager * fix issues * changes in api for remove membership * Merge conflict resolved * 🐞 Channel List bug in mobile view * changes in joining request responses * 🛠 Request Managers Frontend ready * changes in routes for adding and removing remembership * 🚀 New routes implemented for request manager * fix issues * changes in api for remove membership * 🛠Optimizing for CodeClimate * 🛠Optimizing again for CodeClimate * 🛠Optimizing again 2 for CodeClimate * 🛠 Added more test cases * 🛠 Optimizing code * 🛠 vscode file changed * 🛠 Updated schema as requested Co-authored-by: Parasgr-code <paras.gaur@skynox.tech>
54 lines
1.5 KiB
JavaScript
54 lines
1.5 KiB
JavaScript
import { h } from 'preact';
|
|
import render from 'preact-render-to-json';
|
|
import { shallow } from 'preact-render-spy';
|
|
import Content from '../content';
|
|
|
|
const data = [
|
|
{
|
|
onTriggerContent: false,
|
|
resource: { type_of: 'channel-request' },
|
|
activeChannelId: 12345,
|
|
pusherKey: 'ASDFGHJKL',
|
|
githubToken: '',
|
|
},
|
|
{
|
|
onTriggerContent: false,
|
|
resource: { type_of: 'loading-user' },
|
|
activeChannelId: 1235,
|
|
pusherKey: 'ASDFGHJKL',
|
|
githubToken: '',
|
|
},
|
|
];
|
|
|
|
const getContent = (resource) => <Content resource={resource} />;
|
|
|
|
describe('<Content />', () => {
|
|
describe('as loading-user', () => {
|
|
it('should render and test snapshot', () => {
|
|
const tree = render(getContent(data[0]));
|
|
expect(tree).toMatchSnapshot();
|
|
});
|
|
it('should have proper elements, attributes and content', () => {
|
|
const context = shallow(getContent(data[0]));
|
|
expect(
|
|
context.find('.activechatchannel__activecontent').exists(),
|
|
).toEqual(true);
|
|
});
|
|
});
|
|
describe('as channel-request', () => {
|
|
it('should render and test snapshot', () => {
|
|
const tree = render(getContent(data[1]));
|
|
expect(tree).toMatchSnapshot();
|
|
});
|
|
it('should have proper elements, attributes and content', () => {
|
|
const context = shallow(getContent(data[1]));
|
|
expect(
|
|
context.find('.activechatchannel__activecontent').exists(),
|
|
).toEqual(true);
|
|
});
|
|
});
|
|
/*
|
|
testing only as loading user since components that Content uses
|
|
are independently tested
|
|
*/
|
|
});
|