Remove unspecced original_event
field from the readEventRelations
response (#9349)
Signed-off-by: Dominik Henneke <dominik.henneke@nordeck.net> Signed-off-by: Dominik Henneke <dominik.henneke@nordeck.net>
This commit is contained in:
parent
16c3efead5
commit
99488b84ec
2 changed files with 0 additions and 23 deletions
|
@ -434,7 +434,6 @@ export class StopGapWidgetDriver extends WidgetDriver {
|
||||||
}
|
}
|
||||||
|
|
||||||
const {
|
const {
|
||||||
originalEvent,
|
|
||||||
events,
|
events,
|
||||||
nextBatch,
|
nextBatch,
|
||||||
prevBatch,
|
prevBatch,
|
||||||
|
@ -451,7 +450,6 @@ export class StopGapWidgetDriver extends WidgetDriver {
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
originalEvent: originalEvent?.getEffectiveEvent(),
|
|
||||||
chunk: events.map(e => e.getEffectiveEvent()),
|
chunk: events.map(e => e.getEffectiveEvent()),
|
||||||
nextBatch,
|
nextBatch,
|
||||||
prevBatch,
|
prevBatch,
|
||||||
|
|
|
@ -209,7 +209,6 @@ describe("StopGapWidgetDriver", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
await expect(driver.readEventRelations('$event')).resolves.toEqual({
|
await expect(driver.readEventRelations('$event')).resolves.toEqual({
|
||||||
originalEvent: expect.objectContaining({ content: {} }),
|
|
||||||
chunk: [],
|
chunk: [],
|
||||||
nextBatch: undefined,
|
nextBatch: undefined,
|
||||||
prevBatch: undefined,
|
prevBatch: undefined,
|
||||||
|
@ -218,24 +217,6 @@ describe("StopGapWidgetDriver", () => {
|
||||||
expect(client.relations).toBeCalledWith('!this-room-id', '$event', null, null, {});
|
expect(client.relations).toBeCalledWith('!this-room-id', '$event', null, null, {});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('reads related events if the original event is missing', async () => {
|
|
||||||
client.relations.mockResolvedValue({
|
|
||||||
// the relations function can return an undefined event, even
|
|
||||||
// though the typings don't permit an undefined value.
|
|
||||||
originalEvent: undefined as any,
|
|
||||||
events: [],
|
|
||||||
});
|
|
||||||
|
|
||||||
await expect(driver.readEventRelations('$event', '!room-id')).resolves.toEqual({
|
|
||||||
originalEvent: undefined,
|
|
||||||
chunk: [],
|
|
||||||
nextBatch: undefined,
|
|
||||||
prevBatch: undefined,
|
|
||||||
});
|
|
||||||
|
|
||||||
expect(client.relations).toBeCalledWith('!room-id', '$event', null, null, {});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('reads related events from a selected room', async () => {
|
it('reads related events from a selected room', async () => {
|
||||||
client.relations.mockResolvedValue({
|
client.relations.mockResolvedValue({
|
||||||
originalEvent: new MatrixEvent(),
|
originalEvent: new MatrixEvent(),
|
||||||
|
@ -244,7 +225,6 @@ describe("StopGapWidgetDriver", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
await expect(driver.readEventRelations('$event', '!room-id')).resolves.toEqual({
|
await expect(driver.readEventRelations('$event', '!room-id')).resolves.toEqual({
|
||||||
originalEvent: expect.objectContaining({ content: {} }),
|
|
||||||
chunk: [
|
chunk: [
|
||||||
expect.objectContaining({ content: {} }),
|
expect.objectContaining({ content: {} }),
|
||||||
expect.objectContaining({ content: {} }),
|
expect.objectContaining({ content: {} }),
|
||||||
|
@ -272,7 +252,6 @@ describe("StopGapWidgetDriver", () => {
|
||||||
25,
|
25,
|
||||||
'f',
|
'f',
|
||||||
)).resolves.toEqual({
|
)).resolves.toEqual({
|
||||||
originalEvent: expect.objectContaining({ content: {} }),
|
|
||||||
chunk: [],
|
chunk: [],
|
||||||
nextBatch: undefined,
|
nextBatch: undefined,
|
||||||
prevBatch: undefined,
|
prevBatch: undefined,
|
||||||
|
|
Loading…
Reference in a new issue