aboutsummaryrefslogtreecommitdiff
path: root/src/components/post/post.test.js
diff options
context:
space:
mode:
authorRuben Beltran del Rio <ruben@unlimited.pizza>2021-04-22 00:18:28 +0200
committerRuben Beltran del Rio <ruben@unlimited.pizza>2021-04-22 00:18:28 +0200
commit8ae7249a5bb12f23d402f0ede32956827de4e111 (patch)
tree3ddd11865c18748d3856208b0063b3067707868d /src/components/post/post.test.js
parent47b0bfe47e6f13d549897149b0abc4a72ba8ac88 (diff)
Add blink test + coverage improvements
Diffstat (limited to 'src/components/post/post.test.js')
-rw-r--r--src/components/post/post.test.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/components/post/post.test.js b/src/components/post/post.test.js
index 9ab4848..e158ce9 100644
--- a/src/components/post/post.test.js
+++ b/src/components/post/post.test.js
@@ -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();
+ });
});