feat: unit tests for utils (#92)
* init * get unit test working for course.ts file * added some other tests * tests halfway + change config to accomodate js files * utility functions tests done * fix: config file + miscellaneous fixes * fix: prepare script * fix lock file --------- Co-authored-by: Rotimi Best <best@classroomio.com>
This commit is contained in:
co-authored by
Rotimi Best
parent
4b2e58b1de
commit
6d689ede45
+2
-1
@@ -1,4 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { browser } from '$app/environment';
|
||||
import Modal from '$lib/components/Modal/index.svelte';
|
||||
import TextField from '$lib/components/Form/TextField.svelte';
|
||||
import PrimaryButton from '$lib/components/PrimaryButton/index.svelte';
|
||||
@@ -98,7 +99,7 @@
|
||||
}, 500);
|
||||
}
|
||||
|
||||
$: note = getTextFromHTML($lesson?.materials?.note || '');
|
||||
$: note = browser ? getTextFromHTML($lesson?.materials?.note || '') : '';
|
||||
</script>
|
||||
|
||||
<Modal
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { browser } from '$app/environment';
|
||||
import isEmpty from 'lodash/isEmpty';
|
||||
import { useCompletion } from 'ai/svelte';
|
||||
import MODES from '$lib/utils/constants/mode.js';
|
||||
@@ -84,7 +85,7 @@
|
||||
|
||||
if (!document) return false;
|
||||
|
||||
return getTextFromHTML(note) === '';
|
||||
return browser ? getTextFromHTML(note) === '' : false;
|
||||
}
|
||||
|
||||
function isMaterialsEmpty(materials: LessonPage['materials']) {
|
||||
|
||||
Reference in New Issue
Block a user