aboutsummaryrefslogtreecommitdiff
path: root/src/components/topic
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/topic
parent47b0bfe47e6f13d549897149b0abc4a72ba8ac88 (diff)
Add blink test + coverage improvements
Diffstat (limited to 'src/components/topic')
-rw-r--r--src/components/topic/topic.svelte2
-rw-r--r--src/components/topic/topic.test.js8
2 files changed, 9 insertions, 1 deletions
diff --git a/src/components/topic/topic.svelte b/src/components/topic/topic.svelte
index 0b73d44..c0dbfbc 100644
--- a/src/components/topic/topic.svelte
+++ b/src/components/topic/topic.svelte
@@ -5,7 +5,7 @@
import Post from '$/components/post/post.svelte';
import { readableTime } from '$/utils/readable_time.js';
- $: remainingTime = topic ? topic.updated_at + topic.ttl - Date.now() : 0;
+ $: remainingTime = topic.updated_at + topic.ttl - Date.now();
$: remaining = readableTime(remainingTime);
</script>
diff --git a/src/components/topic/topic.test.js b/src/components/topic/topic.test.js
index 83eeba3..ca1abfb 100644
--- a/src/components/topic/topic.test.js
+++ b/src/components/topic/topic.test.js
@@ -105,6 +105,14 @@ describe('Topic component', () => {
.toBeVisible();
});
+ test('Should send index and countt to posts', () => {
+
+ expect(internals.results.getByTitle('Post 1 of 2 by past_user'))
+ .toBeVisible();
+ expect(internals.results.getByTitle('Post 2 of 2 by future_user'))
+ .toBeVisible();
+ });
+
describe('Forum link', () => {
test('Should show forum if the post has one', () => {