From 47b0bfe47e6f13d549897149b0abc4a72ba8ac88 Mon Sep 17 00:00:00 2001 From: Ruben Beltran del Rio Date: Tue, 20 Apr 2021 23:38:02 +0200 Subject: Add tests to second batch of components - Error Block - Forum List - Language Selector - Post - Tag - Topic Summary --- src/components/post/post.svelte | 2 ++ src/components/post/post.test.js | 22 +++++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) (limited to 'src/components/post') diff --git a/src/components/post/post.svelte b/src/components/post/post.svelte index fd9e580..66901af 100644 --- a/src/components/post/post.svelte +++ b/src/components/post/post.svelte @@ -23,9 +23,11 @@ {timestampToISO(post.created_at)} + {#if post.topic} ({$_('post.topic_location')} {post.topic.title}.) + {/if}
{ expect(internals.results.getByText('Parent topic, yes').closest('a')) .toHaveAttribute('href', '/t/35d3c3eb-e486-42ef-994c-d8ab1f1e167a'); }); + + test('Parent topic title should have a permalink to topic', () => { + + cleanup(); + internals.results = render(Post, { props: { + post: internals.postWithoutTopic + } }); + + expect(internals.results.queryByText('Parent topic, yes')) + .toBe(null); + }); }); -- cgit