Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 2ad0032

Browse files
committed
Added regression tests for Natural headers
1 parent cea5421 commit 2ad0032

File tree

2 files changed

+0
-75
lines changed

2 files changed

+0
-75
lines changed

test/components/structures/MessagePanel-test.js

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -264,33 +264,6 @@ describe('MessagePanel', function() {
264264
}),
265265
];
266266
}
267-
268-
//Create a few redacted events
269-
//isRedacted just checks the redacted_because
270-
function mkRedactionEvents() {
271-
const events = [];
272-
const ts0 = Date.now();
273-
let i=0
274-
275-
let redaction = test_utils.mkEvent({
276-
type: "m.room.redaction",
277-
event: true, room: "!room:id", user: "@user:id", ts: ts0 + ++i * 1000 ,
278-
content: {},
279-
});
280-
let event =test_utils.mkRedactedEvent({
281-
type: "m.room.message",
282-
event: true, room: "!room:id", user: "@user:id",
283-
ts: ts0 + i * 1000 ,
284-
// redacted_because: redaction This is not working at the moment
285-
})
286-
redaction.redacts = event.event_id;
287-
288-
events.push(event);
289-
events.push(redaction);
290-
291-
return events;
292-
293-
}
294267

295268
function isReadMarkerVisible(rmContainer) {
296269
return rmContainer && rmContainer.children.length > 0;
@@ -493,19 +466,4 @@ describe('MessagePanel', function() {
493466

494467

495468
})
496-
497-
it('should render only one Date separator for redacted events', function () {
498-
const events = mkRedactionEvents()
499-
const res = mount(
500-
<WrappedMessagePanel
501-
className="cls"
502-
events={events}
503-
/>,
504-
);
505-
const Dates = res.find(sdk.getComponent('messages.DateSeparator'));
506-
507-
expect(Dates.length).toEqual(1);
508-
509-
510-
})
511469
});

test/test-utils.js

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -218,39 +218,6 @@ export function mkMessage(opts) {
218218
return mkEvent(opts);
219219
}
220220

221-
222-
/**
223-
* Create an Redacted Event.
224-
* @param {Object} opts Values for the event.
225-
* @param {string} opts.type The event.type
226-
* @param {string} opts.room The event.room_id
227-
* @param {string} opts.user The event.user_id
228-
* @param {string} opts.skey Optional. The state key (auto inserts empty string)
229-
* @param {Number} opts.ts Optional. Timestamp for the event
230-
* @param {Object} opts.content The event.content
231-
* @param {boolean} opts.event True to make a MatrixEvent.
232-
* @return {Object} a JSON object representing this event.
233-
*/
234-
export function mkRedactedEvent(opts) {
235-
if (!opts.type ) {
236-
throw new Error("Missing .type =>" + JSON.stringify(opts));
237-
}
238-
const event = {
239-
type: opts.type,
240-
room_id: opts.room,
241-
sender: opts.user,
242-
content: {},
243-
prev_content: opts.prev_content,
244-
event_id: "$" + Math.random() + "-" + Math.random(),
245-
origin_server_ts: opts.ts,
246-
//isRedacted() only checks if redacted_because is true or not
247-
// unsigned :{redacted_because:opts.redacted_because} This is not working atm
248-
};
249-
//Might want to add the other parameters for generalized tests
250-
return opts.event ? new MatrixEvent(event) : event;
251-
}
252-
253-
254221
export function mkStubRoom(roomId = null) {
255222
const stubTimeline = { getEvents: () => [] };
256223
return {

0 commit comments

Comments
 (0)