From 8a848deddcfb446fe8ac2bb9d3b042eb657a1c1e Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Mon, 12 Sep 2016 15:52:10 +0100 Subject: [PATCH] unbreak mocks in tests --- spec/unit/event-timeline.spec.js | 5 ++++- spec/unit/timeline-window.spec.js | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/spec/unit/event-timeline.spec.js b/spec/unit/event-timeline.spec.js index f1a8f0109..8cb2f2e48 100644 --- a/spec/unit/event-timeline.spec.js +++ b/spec/unit/event-timeline.spec.js @@ -16,8 +16,11 @@ describe("EventTimeline", function() { beforeEach(function() { utils.beforeEach(this); - // XXX: this is a horrid hack; should use sinon or something instead + + // XXX: this is a horrid hack; should use sinon or something instead to mock var timelineSet = { room: { roomId: roomId }}; + timelineSet.room.getUnfilteredTimelineSet = function() { return timelineSet; }; + timeline = new EventTimeline(timelineSet); }); diff --git a/spec/unit/timeline-window.spec.js b/spec/unit/timeline-window.spec.js index f0f101ede..d04f6b585 100644 --- a/spec/unit/timeline-window.spec.js +++ b/spec/unit/timeline-window.spec.js @@ -20,6 +20,8 @@ function createTimeline(numEvents, baseIndex) { // XXX: this is a horrid hack var timelineSet = { room: { roomId: ROOM_ID }}; + timelineSet.room.getUnfilteredTimelineSet = function() { return timelineSet; }; + var timeline = new EventTimeline(timelineSet); // add the events after the baseIndex first