]> git.r.bdr.sh - rbdr/forum/blobdiff - src/components/post/post.test.js
Update sveltekit version
[rbdr/forum] / src / components / post / post.test.js
index 9ab4848bb3f842dd51b2526d8ea03fa21793a1d9..e158ce9948154e7aef709bf0f6fd72f4a08a7b29 100644 (file)
@@ -102,4 +102,23 @@ describe('Post component', () => {
     expect(internals.results.queryByText('Parent topic, yes'))
       .toBe(null);
   });
+
+  test('It should default to 1/1 when no index or count is passed', () => {
+
+    expect(internals.results.getByTitle('Post 1 of 1 by very_cool_user'))
+      .toBeVisible();
+  });
+
+  test('Parent topic title should have a permalink to topic', () => {
+
+    cleanup();
+    internals.results = render(Post, { props: {
+      index: 2,
+      count: 5,
+      post: internals.postWithoutTopic
+    } });
+
+    expect(internals.results.getByTitle('Post 3 of 5 by my_normal_user'))
+      .toBeVisible();
+  });
 });