FIX: test for fillGapBefore (#10272)

FIX: test for fillGapBefore (#10272)

Missing test for that PR https://github.com/discourse/discourse/pull/10264

diff --git a/test/javascripts/models/post-stream-test.js b/test/javascripts/models/post-stream-test.js
index dbcc4b5..d68f767 100644
--- a/test/javascripts/models/post-stream-test.js
+++ b/test/javascripts/models/post-stream-test.js
@@ -247,6 +247,23 @@ QUnit.test("findPostIdForPostNumber", assert => {
   assert.equal(postStream.findPostIdForPostNumber(8), 60, "it respects gaps");
 });
 
+QUnit.test("fillGapBefore", assert => {
+  const postStream = buildStream(1234, [60]);
+  sandbox.stub(postStream, "findPostsByIds").returns(Promise.resolve([]));
+  let post = postStream.store.createRecord("post", { id: 60, post_number: 60 });
+  postStream.set("gaps", {
+    before: { 60: [51, 52, 53, 54, 55, 56, 57, 58, 59] }
+  });
+
+  postStream.fillGapBefore(post, [51, 52, 53, 54, 55, 56, 57, 58, 59]);
+
+  assert.deepEqual(
+    postStream.stream,
+    [51, 52, 53, 54, 55, 60],
+    "partial results are included in the stream"
+  );
+});
+
 QUnit.test("toggleParticipant", assert => {
   const postStream = buildStream(1236);
   sandbox.stub(postStream, "refresh").returns(Promise.resolve());

GitHub sha: e48e6445

This commit appears in #10272 which was approved by eviltrout. It was merged by lis2.