Wire up drag-drop file uploads for the thread view (#7860)
This commit is contained in:
parent
42e9ea4540
commit
8fccef86d8
30 changed files with 616 additions and 482 deletions
|
@ -1,6 +1,22 @@
|
|||
/*
|
||||
Copyright 2021 The Matrix.org Foundation C.I.C.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import "../../../skinned-sdk";
|
||||
import * as testUtils from '../../../test-utils';
|
||||
import ReplyChain from '../../../../src/components/views/elements/ReplyChain';
|
||||
import { getParentEventId } from "../../../../src/utils/Reply";
|
||||
|
||||
describe("ReplyChain", () => {
|
||||
describe('getParentEventId', () => {
|
||||
|
@ -21,7 +37,7 @@ describe("ReplyChain", () => {
|
|||
room: "room_id",
|
||||
});
|
||||
|
||||
expect(ReplyChain.getParentEventId(originalEventWithRelation))
|
||||
expect(getParentEventId(originalEventWithRelation))
|
||||
.toStrictEqual('$qkjmFBTEc0VvfVyzq1CJuh1QZi_xDIgNEFjZ4Pq34og');
|
||||
});
|
||||
|
||||
|
@ -65,7 +81,7 @@ describe("ReplyChain", () => {
|
|||
originalEventWithRelation.makeReplaced(editEvent);
|
||||
|
||||
// The relation should be pulled from the original event
|
||||
expect(ReplyChain.getParentEventId(originalEventWithRelation))
|
||||
expect(getParentEventId(originalEventWithRelation))
|
||||
.toStrictEqual('$qkjmFBTEc0VvfVyzq1CJuh1QZi_xDIgNEFjZ4Pq34og');
|
||||
});
|
||||
|
||||
|
@ -109,7 +125,7 @@ describe("ReplyChain", () => {
|
|||
originalEvent.makeReplaced(editEvent);
|
||||
|
||||
// The relation should be pulled from the edit event
|
||||
expect(ReplyChain.getParentEventId(originalEvent))
|
||||
expect(getParentEventId(originalEvent))
|
||||
.toStrictEqual('$qkjmFBTEc0VvfVyzq1CJuh1QZi_xDIgNEFjZ4Pq34og');
|
||||
});
|
||||
|
||||
|
@ -158,7 +174,7 @@ describe("ReplyChain", () => {
|
|||
originalEventWithRelation.makeReplaced(editEvent);
|
||||
|
||||
// The relation should be pulled from the edit event
|
||||
expect(ReplyChain.getParentEventId(originalEventWithRelation)).toStrictEqual('$999');
|
||||
expect(getParentEventId(originalEventWithRelation)).toStrictEqual('$999');
|
||||
});
|
||||
|
||||
it('able to clear relation reply from original event by providing empty relation field', () => {
|
||||
|
@ -203,7 +219,7 @@ describe("ReplyChain", () => {
|
|||
originalEventWithRelation.makeReplaced(editEvent);
|
||||
|
||||
// The relation should be pulled from the edit event
|
||||
expect(ReplyChain.getParentEventId(originalEventWithRelation)).toStrictEqual(undefined);
|
||||
expect(getParentEventId(originalEventWithRelation)).toStrictEqual(undefined);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue